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

preguntada hace 3 años553 visualizaciones
1 Respuesta
0

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

respondido hace 3 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas