AWS Certified SysOps Administrator – Associate (legacy) — Question 903
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: A
Explanation
To prevent the stack from hanging indefinitely during the software configuration phase, a timeout mechanism must be defined. Specifying Conditions with a timeout of 4 hours ensures that if the process exceeds this window, the stack creation fails and triggers an automatic rollback. Other attributes like DependsOn, Metadata, or CreationPolicy do not natively support this timeout rollback behavior in the manner specified.