A CloudFormation template must create a virtual private gateway, a customer gateway, a VPN connection, and static routes in a route table. During testing, the stack fails and CloudFormation rolls back. What should the network engineer do to fix the error?
Choose an answer
Tap an option to check your answer.
Correct answer: Add a DependsOn attribute to the route table entry resource and specify the virtual private gateway resource as the dependency..
Why this is the answer
The correct answer is to add a DependsOn attribute to the route table entry resource and specify the virtual private gateway resource as the dependency. CloudFormation processes resources in parallel where possible. When a resource, like a static route in a route table, depends on another resource, such as a virtual private gateway, to be fully created and available, an explicit dependency must be declared. Without DependsOn, CloudFormation might attempt to create the route entry before the virtual private gateway is ready, leading to a failure. Reordering resources in the template does not guarantee creation order. Adding a DependsOn attribute to the virtual private gateway listing the route table entry as a dependency is incorrect because the gateway does not depend on the route entry. A wait condition is not necessary here; DependsOn handles resource creation order directly.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed