A developer is using an AWS CloudFormation template to deploy an application that includes an Amazon S3 bucket. The S3 bucket contains critical application logs that must be preserved. The developer wants to ensure that the S3 bucket is not deleted when the CloudFormation stack is deleted.
Which action should the developer take to meet this requirement?
- ADefine the S3 bucket in the template and reference its deletion protection settings from AWS Systems Manager Parameter Store.
- BManually modify the S3 bucket configuration in the AWS Management Console to enable deletion protection before deleting the stack.
- Set the DeletionPolicy attribute to Retain on the S3 bucket resource in the CloudFormation template.Cevap
- DConfigure the stack to fail and rollback to the ROLLBACK_COMPLETE state if the S3 bucket deletion is initiated.
Cevap
Set the DeletionPolicy attribute to Retain on the S3 bucket resource in the CloudFormation template.
The DeletionPolicy attribute in AWS CloudFormation enables you to preserve or back up a resource when its stack is deleted. Setting this policy to Retain on the S3 bucket resource ensures the bucket remains active and intact in the AWS account even after the parent stack is deleted.
Adım Adım Çözüm
Anahtar Kavram
AWS CloudFormation DeletionPolicy
Tahmini Süre:45s