QuestionQ15

Troubleshooting and Optimization

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
  • 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.
Explanation

For cross-stack references: (B) The developer's template must use Fn::ImportValue to reference outputs from the network team's stack. (D) The network team's template must export the subnets in the Outputs section using the Export parameter. Without both an export in the source stack and an import in the consuming stack, cross-stack references fail. Ref (A) is for same-stack resources; Mappings (C, E) are lookup tables, not for resource references.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!