
Answer-first summary for fast verification
Answer: Utilize Export declaration in the original template's Outputs and ImportValue in subsequent templates.
Option A is correct because it is the most efficient way to reference resources between AWS CloudFormation stacks. By adding an Export declaration to the Outputs section of the original template, you make the resource available for other stacks to import. Using ImportValue in other templates allows you to directly reference the exported value without the need for custom resources or complex logic. This method is straightforward and follows AWS best practices for cross-stack references.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
In AWS CloudFormation, how can you efficiently reference an Amazon S3 bucket created by one template in another template?
A
Utilize Export declaration in the original template's Outputs and ImportValue in subsequent templates.
B
Implement Exported: true for the Content.Bucket and use ImportResource in other templates.
C
Develop a custom CloudFormation resource to retrieve the bucket name from the first stack's ContentBucket.
D
Employ Fn::Include to incorporate the original template and directly reference the ContentBucket resource.