AWS Certified Advanced Networking – Specialty (ANS-C01) — Question 18
A network engineer must develop an AWS CloudFormation template that can create a virtual private gateway, a customer gateway, a VPN connection, and static routes in a route table. During testing of the template, the network engineer notes that the CloudFormation template has encountered an error and is rolling back.
What should the network engineer do to resolve the error?
Answer options
- A. Change the order of resource creation in the CloudFormation template.
- B. Add the DependsOn attribute to the resource declaration for the virtual private gateway. Specify the route table entry resource.
- C. Add a wait condition in the template to wait for the creation of the virtual private gateway.
- D. Add the DependsOn attribute to the resource declaration for the route table entry. Specify the virtual private gateway resource.
Correct answer: D
Explanation
The correct answer is D because the route table entry must depend on the successful creation of the virtual private gateway, ensuring that the gateway exists before the route is established. Options A and C do not address the dependency issue, while option B incorrectly suggests specifying the route table entry as a dependency of the virtual private gateway, which is not necessary.