Skip to content

Instantly share code, notes, and snippets.

@klang
Created Jun 2, 2021
Embed
What would you like to do?
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