
Answer-first summary for fast verification
Answer: !ImportValue
!ImportValue The intrinsic function Fn::ImportValue returns the value of an output exported by another stack. You typically use this function to create cross-stack references. Incorrect options: !Ref - Returns the value of the specified parameter or resource. !GetAtt - Returns the value of an attribute from a resource in the template. !Sub - Substitutes variables in an input string with values that you specify.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
An IT company leverages AWS CloudFormation templates to manage and deploy their AWS infrastructure, which includes resources such as Amazon EC2, Amazon VPC, and Amazon S3. In their architecture setup, they utilize cross-stack referencing to organize and manage dependencies between different CloudFormation stacks. Specifically, a developer has created a stack named NetworkStack that exports a value for subnetId. This subnetId is intended to be used for provisioning EC2 instances in a separate stack.
Given this scenario, to reference the exported value of subnetId in another CloudFormation stack, which of the following functions should be used?
A
!ImportValue
B
!GetAtt
C
!Sub
D
!Ref
No comments yet.