Skip to content

Commit

Permalink
added validation for s3 integration types
Browse files Browse the repository at this point in the history
  • Loading branch information
daidokoro committed Jul 15, 2024
1 parent ca782c0 commit 3153860
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ Rules:
Assertions:
- Assert: !Not [ !Equals [ !Ref CloudWatchLogGroupName, '' ] ]
AssertDescription: CloudWatchLogGroupName must be set when IntegrationType is set to cloudwatch
- Assert: !Equals [ !Ref S3BucketName, '' ]
- Assert: !Equals [ !Ref S3BucketName, 'none' ]
AssertDescription: S3Bucket parameter must be empty when IntegrationType is set to cloudwatch

ValidateCustomDomain:
Expand Down Expand Up @@ -497,6 +497,16 @@ Rules:
- !Not [ !Equals [ !Ref LambdaSubnetID, '' ] ]
- !Not [ !Equals [ !Ref LambdaSecurityGroupID, '' ] ]
AssertDescription: Subnet ID and Security Group ID must be set when UsePrivateLink is set to true

ValidationS3Integrations:
RuleCondition: !Or
- !Equals [ !Ref IntegrationType, 'S3' ]
- !Equals [ !Ref IntegrationType, 'CloudTrail' ]
- !Equals [ !Ref IntegrationType, 'VpcFlow' ]
- !Equals [ !Ref IntegrationType, 'S3Csv' ]
Assertions:
- Assert: !Not [ !Equals [ !Ref S3BucketName, 'none' ] ]
AssertDescription: S3BucketName must be set when IntegrationType is set to S3, CloudTrail, VpcFlow or S3Csv

ValidateKafkaIntegrationParams:
RuleCondition: !Equals [ !Ref IntegrationType, 'Kafka' ]
Expand Down

0 comments on commit 3153860

Please sign in to comment.