
AWS Certified Developer - Associate
Get started today
Ultimate access to all questions.
A team working at a technology company uses AWS CloudFormation to manage its AWS infrastructure. They have already created a network stack that includes a Virtual Private Cloud (VPC) with subnets. Additionally, they have a web application stack that consists of EC2 instances and an RDS instance. The team aims to integrate the VPC from the network stack into the web application stack. As an AWS Certified Developer Associate, what solution would you recommend for this scenario?
A team working at a technology company uses AWS CloudFormation to manage its AWS infrastructure. They have already created a network stack that includes a Virtual Private Cloud (VPC) with subnets. Additionally, they have a web application stack that consists of EC2 instances and an RDS instance. The team aims to integrate the VPC from the network stack into the web application stack. As an AWS Certified Developer Associate, what solution would you recommend for this scenario?
Explanation:
The correct solution for referencing the VPC created in the network stack into the web application stack when using AWS CloudFormation is to create a cross-stack reference. This involves using the Export output field to flag the value of the VPC from the network stack. Once the VPC value is exported, the Fn::ImportValue intrinsic function is used to import this value into the web application stack. This approach allows for the sharing of resource values across different stacks, enabling modular and maintainable infrastructure management. AWS CloudFormation provides an organized and predictable way to create and manage AWS resources, which is particularly useful for developers and businesses looking to streamline their infrastructure provisioning processes.