Skip to main content

AWS DVA-C02 Drill: Cross-Stack Resource Sharing - Efficient S3 Bucket Referencing

Jeff Taakey
Author
Jeff Taakey
21+ Year Enterprise Architect | AWS SAA/SAP & Multi-Cloud Expert.

Jeff’s Note
#

Unlike generic exam dumps, ADH analyzes this scenario through the lens of a Real-World Lead Developer.

For AWS DVA-C02 candidates, the confusion often lies in how to efficiently and cleanly share resources, like an S3 bucket, across multiple CloudFormation stacks without manual intervention or brittle solutions. In production, this is about knowing exactly how to export and import outputs to enable loose coupling and repeatable deployments across modules. Let’s drill down.

The Certification Drill (Simulated Question)
#

Scenario
#

Imagine your team at BrightByte Media is automating infrastructure for a media content platform. One CloudFormation stack creates a new S3 bucket to hold shared asset files. The bucket name is randomly generated to avoid naming conflicts across environments. Another stack responsible for the application backend needs to reference this bucket to upload and retrieve files.

The Requirement
#

You want the most efficient and AWS-recommended method for the backend stack to refer to the bucket resource created in the separate CloudFormation stack without hardcoding bucket names or creating custom resources.

The Options
#

  • A) Add an Export declaration to the Outputs section of the original stack’s template and use ImportValue in the backend stack’s template.
  • B) Add Exported: true to the ContentBucket resource definition in the original template and use an ImportResource statement in the backend stack.
  • C) Create a custom CloudFormation resource that uses a Lambda function to query the bucket name from the original stack and returns it for the backend stack to consume.
  • D) Use Fn::Include intrinsic function to include the original S3 bucket template inside the backend stack and reference the bucket resource directly.

Google adsense
#

leave a comment:

Correct Answer
#

A

Quick Insight: The Developer Imperative
#

The best practice for cross-stack references in CloudFormation is to export outputs and use ImportValue to maintain loose coupling, ensure stack independence, and enable clean CI/CD deployment automation. Custom resources or direct inclusion are unnecessary complexity or unsupported approaches.

Content Locked: The Expert Analysis
#

You’ve identified the answer. But do you know the implementation details that separate a Junior from a Senior?


The Expert’s Analysis
#

Correct Answer
#

Option A

The Winning Logic
#

Option A uses the CloudFormation Export/Import pattern, the built-in, AWS-native method for sharing values like resource names or ARNs between stacks. By adding an Export attribute in the Outputs section of the producer stack, AWS ensures consistency and prevents circular dependencies when the consumer stack uses ImportValue to reference that exported value.

  • This keeps stacks modular and independently deployable.
  • The exported name acts like a contract between stacks.
  • Reduces hardcoding and the need for complex custom logic or polling handlers.

The Trap (Distractor Analysis)
#

  • Option B: Exported: true and ImportResource do not exist as CloudFormation syntax. This is a fictional feature and would cause template validation errors.
  • Option C: Creating Lambda-backed custom resources for this use case is overly complex, unnecessary, and harder to maintain. Also, it introduces IAM and lifecycle management overhead.
  • Option D: Fn::Include does not exist as a CloudFormation intrinsic function. Even if it did, including one stack inside another blurs the independence of stacks and may cause update conflicts.

The Technical Blueprint
#

# To export the bucket name in the producer stack template:
Outputs:
  ContentBucketName:
    Description: "Name of S3 bucket"
    Value: !Ref ContentBucket
    Export:
      Name: BrightByte-ContentBucketName

# To import and reference in the consumer stack:
Resources:
  BackendAppRole:
    Type: AWS::IAM::Role
    Properties:
      Policies:
        - PolicyName: AccessBucket
          PolicyDocument:
            Statement:
              - Effect: Allow
                Action:
                  - s3:GetObject
                  - s3:PutObject
                Resource:
                  - !Sub "arn:aws:s3:::${ImportValue BrightByte-ContentBucketName}/*"

The Comparative Analysis
#

Option API/Template Validity Complexity Maintainability Use Case Fit
A Valid export/import Low High Standard cross-stack ref
B Invalid syntax N/A N/A Does not exist
C Valid but custom High Low Overkill and fragile
D Invalid syntax N/A N/A Not supported

Real-World Application (Practitioner Insight)
#

Exam Rule
#

For the exam, always pick Export/ImportValue when you see a question about referencing resources across CloudFormation stacks.

Real World
#

In large applications, this export-import pattern enables sharing only necessary values, reducing blast radius, and allowing different teams or CI pipelines to own separate stacks without tight coupling.


(CTA) Stop Guessing, Start Mastering
#


Disclaimer

This is a study note based on simulated scenarios for the AWS DVA-C02 exam.

The DevPro Network: Mission and Founder

A 21-Year Tech Leadership Journey

Jeff Taakey has driven complex systems for over two decades, serving in pivotal roles as an Architect, Technical Director, and startup Co-founder/CTO.

He holds both an MBA degree and a Computer Science Master's degree from an English-speaking university in Hong Kong. His expertise is further backed by multiple international certifications including TOGAF, PMP, ITIL, and AWS SAA.

His experience spans diverse sectors and includes leading large, multidisciplinary teams (up to 86 people). He has also served as a Development Team Lead while cooperating with global teams spanning North America, Europe, and Asia-Pacific. He has spearheaded the design of an industry cloud platform. This work was often conducted within global Fortune 500 environments like IBM, Citi and Panasonic.

Following a recent Master’s degree from an English-speaking university in Hong Kong, he launched this platform to share advanced, practical technical knowledge with the global developer community.


About This Site: AWS.CertDevPro.com


AWS.CertDevPro.com focuses exclusively on mastering the Amazon Web Services ecosystem. We transform raw practice questions into strategic Decision Matrices. Led by Jeff Taakey (MBA & 21-year veteran of IBM/Citi), we provide the exclusive SAA and SAP Master Packs designed to move your cloud expertise from certification-ready to project-ready.