You created a new Amazon S3 bucket in one AWS CloudFormation stack. What is the most efficient way to reference that S3 bucket from a different CloudFormation stack?
Choose an answer
Tap an option to check your answer.
Correct answer: Add an Export entry to the Outputs section of the original template and use ImportValue in the other template..
Why this is the answer
The most efficient way to reference resources across CloudFormation stacks is by using Outputs and Imports. You define an Export in the Outputs section of the stack that creates the resource (the S3 bucket in this case). This makes the output value available for other stacks to consume. The consuming stack then uses the Fn::ImportValue intrinsic function to retrieve the exported value. This creates a direct, managed dependency between the stacks, ensuring that the exported value is available and correctly referenced. Incorrect options: Exported: true and ImportResource are not valid CloudFormation constructs. Creating a custom CloudFormation resource would be overly complex and inefficient for a standard cross-stack reference. Fn::Include is used for including snippets of CloudFormation templates within the same stack, not for referencing resources between separate stacks.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed