AWS Certified CloudOps Engineer - Associate (SOA-C03) free question 5 / 10 · Domain 3: Deployment, Provisioning, and Automation
A network stack creates a VPC, a subnet, and a security group. A separate web application stack must use that subnet and security group, and the owners of the application stack should not have to maintain networking assets. How should the engineer connect the two stacks?
- Copy the subnet and security group IDs into the application stack as parameters whose values the owners enter at the time of the deployment
- Put the network resources and the application resources into one template, so that the two stacks become one stack
- Export the subnet and security group IDs in the Outputs of the network stack, and use Fn::ImportValue in the application stack
- Use Fn::GetAtt in the application stack with the logical ID of the subnet in the network stack as the source of the value
Show the answer and explanation
Answer: C
Why this is correct
A cross-stack reference lets one stack use resource outputs of another. The producing stack marks the value of an output for export with the Export field, and the consuming stack imports it with the Fn::ImportValue intrinsic function. Restricting references to outputs lets the owner of the network stack control which parts of it other stacks can use, so the application owners do not maintain networking assets.
Why the other options are wrong
"Copy the subnet and security group IDs into the application stack as parameters whose values the owners enter at the time of the deployment" … Typing the values by hand is not a cross-stack reference, and it leaves the owners of the application stack to track networking assets.
"Put the network resources and the application resources into one template, so that the two stacks become one stack" … The page splits related resources into separate stacks to make templates modular and reusable. A single template gives up that separation.
"Use Fn::GetAtt in the application stack with the logical ID of the subnet in the network stack as the source of the value" … A cross-stack reference works through an exported output and Fn::ImportValue. Logical IDs belong to the template of their own stack.
Key points
Splitting related resources into separate stacks makes templates more modular and reusable. The page walks through a network stack and a web application stack built from sample templates. The page examples create a VPC, a security group, and a subnet in the network stack, and then import them into the web application stack.