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.
data "aws_cloudformation_export" "subnet_id" {
name = "mySubnetIdExportName"
}
resource "aws_instance" "web" {
ami = "ami-abb07bcb"
instance_type = "t2.micro"
subnet_id = data.aws_cloudformation_export.subnet_id.value
}
name
- (Required) Name of the export as it appears in the console or from list-exportsThis data source exports the following attributes in addition to the arguments above:
value
- Value from Cloudformation export identified by the export name found from list-exportsexporting_stack_id
- ARN of stack that contains the exported output name and value.