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

posta 3 anni fa553 visualizzazioni
1 Risposta
0

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

con risposta 3 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande