AWS Certified SysOps Administrator – Associate — Question 89
A company creates custom AMI images by launching new Amazon EC2 instances from an AWS CloudFormation template. It installs and configures necessary software through AWS OpsWorks, and takes images of each EC2 instance. The process of installing and configuring software can take between 2 to 3 hours, but at times, the process stalls due to installation errors.
The SysOps administrator must modify the CloudFormation template so if the process stalls, the entire stack will fail and roll back.
Based on these requirements, what should be added to the template?
Answer options
- A. Conditions with a timeout set to 4 hours.
- B. CreationPolicy with a timeout set to 4 hours.
- C. DependsOn with a timeout set to 4 hours.
- D. Metadata with a timeout set to 4 hours.
Correct answer: B
Explanation
The correct answer is B, as adding a CreationPolicy with a timeout allows the stack to monitor resources and enforce a rollback if the installation process exceeds the specified time limit. The other options do not provide the necessary functionality to handle process timeouts and enforce a rollback in the event of a stall.