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

demandé il y a 3 ans554 vues
1 réponse
0

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

répondu il y a 3 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions