# Stack Output Resolvers
This example demonstrates how to use stack output resolver to read outputs from one stack and use them as input parameters in another stack.
When the example is deployed, the custom resolvers are used to resolve values for the stack parameters.
See the complete example at GitHub.
The example consists of the following files:
. ├─ stacks │ ├- security-groups.yml │ └- vpc.yml └─ templates ├- security-groups.yml └- vpc.yml
There are two stacks:
security-groups.yml. The former creates a VPC and the latter takes the VPC's id as a parameter and uses it to create a security group.
The template of
vpc.yml stack contains the VPC resource whose id is exposed through stack outputs:
Resources: VPC: Type: AWS::EC2::VPC Properties: CidrBlock: 10.0.0.0/24 Outputs: VpcId: Description: VPC id Value: !Ref VPC
The configuration file of
security-groups.yml stack uses
stack-output resolver to read the value for the
parameters: VpcId: resolver: stack-output stack: /vpc.yml output: VpcId
# Deploy Stacks
To deploy the example stacks, run command:
tkm stacks deploy
# Remove Stacks
To remove the created stacks, run command:
tkm stacks undeploy
# See Also
Find more information from the documentation: