Skip to content

Data Source: awsCloudformationExport

The CloudFormation Export data source allows access to stack exports specified in the Output section of the Cloudformation Template using the optional Export Property.

-> Note: If you are trying to use a value from a Cloudformation Stack in the same Terraform run please use normal interpolation or Cloudformation Outputs.

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 dataAwsCloudformationExportSubnetId =
  new aws.dataAwsCloudformationExport.DataAwsCloudformationExport(
    this,
    "subnet_id",
    {
      name: "mySubnetIdExportName",
    }
  );
new aws.instance.Instance(this, "web", {
  ami: "ami-abb07bcb",
  instanceType: "t2.micro",
  subnetId: dataAwsCloudformationExportSubnetId.value,
});

Argument Reference

  • name - (Required) Name of the export as it appears in the console or from list-exports

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • value - Value from Cloudformation export identified by the export name found from list-exports
  • exportingStackId - ARN of stack that contains the exported output name and value.