Challenge - 5 Problems
Cross-Stack Reference Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate2:00remaining
What is the output of this CloudFormation stack's output section?
Given this CloudFormation output configuration, what will be the value of the output named BucketNameOutput after deployment?
Outputs:
BucketNameOutput:
Description: "Name of the S3 bucket"
Value: !Ref MyS3Bucket
Export:
Name: "MyApp-BucketName"
Attempts:
2 left
💡 Hint
The !Ref function returns the logical resource's name or ID depending on the resource type.
✗ Incorrect
The !Ref function on an S3 bucket returns the bucket's name, which is the physical resource name. This is what the output exports for cross-stack use.
❓ Architecture
intermediate2:00remaining
Which option correctly describes how to import a value exported by another stack?
You have a CloudFormation stack exporting a value named MyApp-BucketName. How can another stack import this value to use it in a resource property?
Attempts:
2 left
💡 Hint
Look for the function designed to import exported values across stacks.
✗ Incorrect
The !ImportValue function imports a value exported by another stack using the export name. !Ref and !GetAtt do not work for cross-stack imports.
❓ security
advanced2:00remaining
What is a security risk when exporting sensitive information in stack outputs?
If a CloudFormation stack exports a secret key or password in its Outputs section, what is the main security risk?
Attempts:
2 left
💡 Hint
Consider who can view stack outputs and exports in AWS.
✗ Incorrect
Stack outputs are visible to anyone with permissions to view the stack, so exporting secrets can expose them unintentionally.
❓ Configuration
advanced2:00remaining
What error occurs if two stacks export outputs with the same name?
Two CloudFormation stacks export outputs with the same export name MyApp-BucketName. What happens when you try to deploy the second stack?
Attempts:
2 left
💡 Hint
Export names must be unique across all stacks in an AWS account and region.
✗ Incorrect
CloudFormation requires export names to be unique. Duplicate export names cause deployment validation errors.
✅ Best Practice
expert3:00remaining
Which approach best ensures stable cross-stack references when stack resources are renamed or replaced?
You want to export a resource identifier for cross-stack use, but the resource's logical ID or physical name might change during updates. What is the best practice to maintain stable references?
Attempts:
2 left
💡 Hint
Think about what stays constant even if the resource is replaced.
✗ Incorrect
Exporting a stable, manually set value (like a parameter or a fixed resource attribute) avoids breaking references if logical or physical IDs change.