Cross stack references
You can have multiple templates that create multiple stacks in your AWS accounts, and you may have a need to reference resources created in one stack with another. CloudFormation provides you with the ability to export the value of a variable from one stack and import it into another stack. You can export the value of a variable in the Outputs
section of your CloudFormation source template, and import the value in the Resources
section of the template where you are making the reference.

In the preceding example, you can see that Network Stack
has the ProdVPC
name exported and App Stack
has the ProdVPC
name imported. The export names that you specify must be unique within the account and the given region. The features of CloudFormation do not allow you to create references across regions. In addition, you cannot delete a stack that is being referenced by another stack, and output in the source template cannot be changed or removed while it is being referenced by the...