Cloudformation deletion deleting the S3 bucket in spite of DeletionPolicy:

0

I have a cloud formation template with the following, if I delete the stack the bucket still gets deleted even though the bucket DeletionPolicy is Retain.

Resources:
mybucket123:
Type: 'AWS::S3::Bucket'
DeletionPolicy: Retain
Properties: {
AccessControl: Private
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
VersioningConfiguration:
Status: Enabled
}
Outputs:
S3Bucket:
Description: CFT Bucket.
Value: !Ref mybucket123

已提问 3 年前554 查看次数
1 回答
0

The code was written in template tab and saved, worked fine.

已回答 3 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则