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
The code was written in template tab and saved, worked fine.
You are not logged in. Log in to post an answer.
A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.