A financial services company runs a complex, multi-tier application on Amazon EC2 instances and AWS Lambda functions. The application stores temporary data in Amazon S3. The S3 objects are valid for only 45 minutes and are deleted after 24 hours. The company deploys each version of the application by launching an AWS CloudFormation stack. The stack creates all resources that are required to run the application. When the company deploys and validates a new application version, the company deletes the CloudFormation stack of the old version. The company recently tried to delete the CloudFormation stack of an old application version, but the operation failed. An analysis shows that CloudFormation failed to delete an existing S3 bucket. A solutions architect needs to resolve this issue without making major changes to the application's architecture. Which solution meets these requirements?
Select one answer.
Marked answer: A
Community Discussion
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
Chose A1
the answer is A. C is not much since you can not create an S3 Lifecycle rule that expires all objects 45 minutes after creation. (24h is minimum)
1
A is correct, This solution meets the requirements because it allows you to delete the S3 bucket when deleting the CloudFormation stack, which was failing due to the bucket not being deleted. By implementing a Lambda function as a custom resource, you can trigger it to delete the S3 bucket when the CloudFormation stack is deleted, ensuring that all resources are properly cleaned up.
2
100% HunkyBunky explanation. You cannot just delete a non-empty bucket