AWS Certified Developer – Associate (DVA-C02) — Question 350
A developer at a company writes an AWS CloudFormation template. The template refers to subnets that were created by a separate AWS CloudFormation template that the company's network team wrote. When the developer attempts to launch the stack for the first time, the launch fails.
Which template coding mistakes could have caused this failure? (Choose two.)
Answer options
- A. The developer's template does not use the Ref intrinsic function to refer to the subnets.
- B. The developer's template does not use the ImportValue intrinsic function to refer to the subnets.
- C. The Mappings section of the developer's template does not refer to the subnets.
- D. The network team's template does not export the subnets in the Outputs section.
- E. The network team's template does not export the subnets in the Mappings section.
Correct answer: B, D
Explanation
To share resources like subnets across separate AWS CloudFormation stacks, the producing stack must define and export those resources in its Outputs section. The consuming stack must then retrieve those values using the Fn::ImportValue intrinsic function. Failure to export the values or failure to import them using ImportValue will result in deployment failure.