Data Source: awsCloudformationStack
The CloudFormation Stack data source allows access to stack outputs and other useful data including the template body.
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const dataAwsCloudformationStackNetwork =
new aws.dataAwsCloudformationStack.DataAwsCloudformationStack(
this,
"network",
{
name: "my-network-stack",
}
);
new aws.instance.Instance(this, "web", {
ami: "ami-abb07bcb",
instanceType: "t2.micro",
subnetId: `\${${dataAwsCloudformationStackNetwork.outputs.fqn}["SubnetId"]}`,
tags: {
Name: "HelloWorld",
},
});
Argument Reference
The following arguments are supported:
name
- (Required) Name of the stack
Attributes Reference
In addition to all arguments above, the following attributes are exported:
capabilities
- List of capabilitiesdescription
- Description of the stackdisableRollback
- Whether the rollback of the stack is disabled when stack creation failsnotificationArns
- List of SNS topic ARNs to publish stack related eventsoutputs
- Map of outputs from the stack.parameters
- Map of parameters that specify input parameters for the stack.tags
- Map of tags associated with this stack.templateBody
- Structure containing the template body.iamRoleArn
- ARN of the IAM role used to create the stack.timeoutInMinutes
- Amount of time that can pass before the stack status becomesCREATE_FAILED