DVA-C02 Deployment Practice Question
A company deploys a microservices application using AWS CloudFormation. Each microservice is deployed as a separate stack. The developer wants to pass the output values (e.g., API endpoint URLs) from one stack to another. Which CloudFormation feature should be used?
⚠ Common exam trap
DVA-C02 often tests the difference between nested stacks and cross-stack references. Candidates may confuse nested stacks (which are part of a single stack) with cross-stack references (which link separate stacks).
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Cross-stack references using Export and ImportValue
Cross-stack references using Export and ImportValue allow you to share values between CloudFormation stacks. You export a value from one stack and import it into another, enabling loose coupling. This is the standard way to pass outputs between separate stacks.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Custom resources with Lambda
Why it's wrong here
This approach involves creating a Lambda function to perform custom logic, such as retrieving a value from a central store (e.g., S3, Parameter Store) or another CloudFormation stack, and then using a CloudFormation Custom Resource to invoke that Lambda. While technically possible, it introduces significant operational overhead, including managing Lambda code, permissions, and deployment, making it an overly complex solution for the straightforward task of sharing a value between CloudFormation stacks. AWS CloudFormation provides more direct and native mechanisms for this purpose.
- ✗
Stack outputs
Why it's wrong here
CloudFormation stack outputs are designed to expose values from a stack, making them visible in the AWS console or accessible via the AWS CLI `describe-stacks` command. However, these outputs are inherently scoped to the stack they originate from. They cannot be directly referenced by *other independent CloudFormation stacks* unless explicitly marked for export, which is a specific feature distinct from merely defining an output. Therefore, simply defining an output does not enable cross-stack referencing.
- ✗
Nested stacks
Why it's wrong here
Nested stacks are a CloudFormation feature where one stack (the parent) deploys other stacks (the children) as part of its own template. This creates a hierarchical relationship where the parent stack manages the lifecycle of its nested children, and values can be passed down or up within this specific parent-child structure. However, the question implies independent microservices applications, suggesting separate, standalone CloudFormation stacks that need to share values, not a tightly coupled parent-child deployment model. Nested stacks are for organizing components *within* a larger application, not for sharing values between truly independent applications.
- ✓
Cross-stack references using Export and ImportValue
Why this is correct
This is the native and most efficient CloudFormation mechanism for sharing values between *independent* stacks. A stack can explicitly `Export` an output value, making it discoverable and consumable by other CloudFormation stacks within the same AWS account and region. These other stacks can then use the `Fn::ImportValue` intrinsic function to reference the exported value by its unique name, establishing a direct and managed dependency without requiring custom code or complex workarounds. This approach ensures proper dependency tracking and simplifies value propagation.
Go deeper
Related to this question
About these practice questions
Courseiva writes every DVA-C02 question from scratch — 1,135 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.