Last active
March 19, 2024 20:01
-
-
Save ariesmcrae/852d2959416ca06b8cbd87477b5c1cdc to your computer and use it in GitHub Desktop.
Cloudformation AWS::Include parser is very strict. Must put quotes everywhere. Otherwise, you'll get "InvalidAttributeValue". Here's a correct example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S3Bucket: | |
Type: "AWS::S3::Bucket" | |
Properties: | |
BucketName: | |
Fn::Sub: "${TagProduct}-${TagEnvironment}-${TagEnvironmentNumber}-audit-${AWS::AccountId}-${AWS::Region}" | |
NotificationConfiguration: | |
QueueConfigurations: | |
- Event: "s3:ObjectCreated:*" | |
Queue: | |
Fn::GetAtt: [ "ObjectCreatedQueueAudit", "Arn" ] | |
Filter: | |
S3Key: | |
Rules: | |
- Name: "suffix" | |
Value: ".json" | |
AuditDLQ: | |
Type: "AWS::SQS::Queue" | |
Properties: | |
QueueName: | |
Fn::Sub: "${TagProduct}-${TagEnvironment}-${TagEnvironmentNumber}-audit-dlq" | |
VisibilityTimeout: 30 | |
AuditQueue: | |
Type: "AWS::SQS::Queue" | |
Properties: | |
QueueName: | |
Fn::Sub: "${TagProduct}-${TagEnvironment}-${TagEnvironmentNumber}-audit" | |
ReceiveMessageWaitTimeSeconds: 1 | |
VisibilityTimeout: 5 | |
RedrivePolicy: | |
deadLetterTargetArn: | |
Fn::GetAtt: [ "AuditDLQ", "Arn" ] | |
maxReceiveCount: 5 | |
ObjectCreatedQueueAudit: | |
Type: AWS::SQS::Queue | |
Properties: | |
VisibilityTimeout: 600 | |
ObjectCreatedQueuePolicy: | |
Type: AWS::SQS::QueuePolicy | |
Properties: | |
Queues: | |
- Ref: ObjectCreatedQueueAudit | |
PolicyDocument: | |
Id: QueuePolicy | |
Version: "2012-10-17" | |
Statement: | |
- Sid: AllowS3ToPushTransaction | |
Effect: Allow | |
Principal: | |
AWS: "*" | |
Action: sqs:SendMessage | |
Resource: | |
- Fn::GetAtt: ["ObjectCreatedQueueAudit", "Arn"] | |
Condition: | |
ArnEquals: | |
aws:SourceArn: | |
Fn::Sub: "arn:aws:s3:::${TagProduct}-${TagEnvironment}-${TagEnvironmentNumber}-audit-${AWS::AccountId}-${AWS::Region}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment