Skip to content

Instantly share code, notes, and snippets.

@klang
Created June 2, 2021 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klang/73285f3b895137d20646c7833c2e6ca4 to your computer and use it in GitHub Desktop.
Save klang/73285f3b895137d20646c7833c2e6ca4 to your computer and use it in GitHub Desktop.
S3Bucket with notification

Why oh why does the 6th update fail?

aws cloudformation create-stack --stack-name bucket --template-body file://bucket1.yaml
aws cloudformation update-stack --stack-name bucket --template-body file://bucket2.yaml
aws cloudformation update-stack --stack-name bucket --template-body file://bucket3.yaml
aws cloudformation update-stack --stack-name bucket --template-body file://bucket4.yaml
aws cloudformation update-stack --stack-name bucket --template-body file://bucket5.yaml
aws cloudformation update-stack --stack-name bucket --template-body file://bucket6.yaml

In principle, this should work .. but doesn't ..

aws cloudformation delete-stack --stack-name bucket
aws cloudformation create-stack --stack-name bucket --template-body file://bucket6.yaml
Resources:
Bucket:
Type: AWS::S3::Bucket
Resources:
Bucket:
Type: AWS::S3::Bucket
Properties:
AccessControl: BucketOwnerFullControl
Resources:
Bucket:
Type: AWS::S3::Bucket
Properties:
AccessControl: BucketOwnerFullControl
LifecycleConfiguration:
Rules:
- ExpirationInDays: 730
Id: Rule001
Prefix: /
Status: Enabled
Resources:
Bucket:
Type: AWS::S3::Bucket
Properties:
AccessControl: BucketOwnerFullControl
LifecycleConfiguration:
Rules:
- ExpirationInDays: 730
Id: Rule001
Prefix: /
Status: Enabled
SNSTopic:
Type: AWS::SNS::Topic
Resources:
Bucket:
DependsOn: SNSTopic
Type: AWS::S3::Bucket
Properties:
AccessControl: BucketOwnerFullControl
LifecycleConfiguration:
Rules:
- ExpirationInDays: 730
Id: Rule001
Prefix: /
Status: Enabled
SNSTopic:
Type: AWS::SNS::Topic
Resources:
Bucket:
DependsOn: SNSTopic
Type: AWS::S3::Bucket
Properties:
AccessControl: BucketOwnerFullControl
LifecycleConfiguration:
Rules:
- ExpirationInDays: 730
Id: Rule001
Prefix: /
Status: Enabled
NotificationConfiguration:
TopicConfigurations:
- Event: 's3:ObjectCreated:*'
Filter:
S3Key:
Rules:
- Name: prefix
Value: '/'
Topic: !Ref SNSTopic
SNSTopic:
Type: AWS::SNS::Topic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment