nerdexam
Amazon

DVA-C02 · Question #367

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 t

The correct answer is B. The developer's template does not use the ImportValue intrinsic function to refer to the subnets. D. The network team's template does not export the subnets in the Outputs section.. Cross-stack references in CloudFormation require the producing stack to export values in its Outputs section and the consuming stack to import them using Fn::ImportValue; both sides must be configured correctly.

Submitted by rohit_dlh· Mar 5, 2026Deployment

Question

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.)

Options

  • AThe developer's template does not use the Ref intrinsic function to refer to the subnets.
  • BThe developer's template does not use the ImportValue intrinsic function to refer to the subnets.
  • CThe Mappings section of the developer's template does not refer to the subnets.
  • DThe network team's template does not export the subnets in the Outputs section.
  • EThe network team's template does not export the subnets in the Mappings section.

How the community answered

(25 responses)
  • A
    4% (1)
  • B
    72% (18)
  • C
    16% (4)
  • E
    8% (2)

Why each option

Cross-stack references in CloudFormation require the producing stack to export values in its Outputs section and the consuming stack to import them using Fn::ImportValue; both sides must be configured correctly.

AThe developer's template does not use the Ref intrinsic function to refer to the subnets.

The Ref intrinsic function resolves logical resource IDs or parameter values within the same template and cannot resolve resources or outputs defined in a separate CloudFormation stack.

BThe developer's template does not use the ImportValue intrinsic function to refer to the subnets.Correct

The developer's template must use the Fn::ImportValue intrinsic function (not Ref) to consume values that were exported by another stack; attempting to reference a cross-stack value with any other function will cause the template to fail at validation or launch.

CThe Mappings section of the developer's template does not refer to the subnets.

The Mappings section is a static lookup table for values hardcoded within the same template; it has no mechanism to reference or retrieve values from another CloudFormation stack.

DThe network team's template does not export the subnets in the Outputs section.Correct

The network team's template must declare the subnet IDs in its Outputs section with an Export.Name field; without this explicit export, the subnet values are private to that stack and cannot be referenced by any other CloudFormation stack using Fn::ImportValue.

EThe network team's template does not export the subnets in the Mappings section.

The Mappings section of the network team's template is irrelevant to cross-stack sharing; the Outputs section with an Export block is the only CloudFormation mechanism that makes values available to other stacks.

Concept tested: CloudFormation cross-stack reference with Outputs export and Fn::ImportValue

Source: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/walkthrough-crossstackref.html

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice