GetExport

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 deployment please use normal interpolation or Cloudformation Outputs.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var subnetId = Output.Create(Aws.CloudFormation.GetExport.InvokeAsync(new Aws.CloudFormation.GetExportArgs
        {
            Name = "mySubnetIdExportName",
        }));
        var web = new Aws.Ec2.Instance("web", new Aws.Ec2.InstanceArgs
        {
            Ami = "ami-abb07bcb",
            InstanceType = "t1.micro",
            SubnetId = subnetId.Apply(subnetId => subnetId.Value),
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/cloudformation"
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        subnetId, err := cloudformation.GetExport(ctx, &cloudformation.GetExportArgs{
            Name: "mySubnetIdExportName",
        }, nil)
        if err != nil {
            return err
        }
        _, err = ec2.NewInstance(ctx, "web", &ec2.InstanceArgs{
            Ami:          pulumi.String("ami-abb07bcb"),
            InstanceType: pulumi.String("t1.micro"),
            SubnetId:     pulumi.String(subnetId.Value),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

subnet_id = aws.cloudformation.get_export(name="mySubnetIdExportName")
web = aws.ec2.Instance("web",
    ami="ami-abb07bcb",
    instance_type="t1.micro",
    subnet_id=subnet_id.value)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const subnetId = pulumi.output(aws.cloudformation.getExport({
    name: "mySubnetIdExportName",
}, { async: true }));
const web = new aws.ec2.Instance("web", {
    ami: "ami-abb07bcb",
    instanceType: "t1.micro",
    subnetId: subnetId.value,
});

Using GetExport

function getExport(args: GetExportArgs, opts?: InvokeOptions): Promise<GetExportResult>
function  get_export(name=None, opts=None)
func GetExport(ctx *Context, args *GetExportArgs, opts ...InvokeOption) (*GetExportResult, error)
public static class GetExport {
    public static Task<GetExportResult> InvokeAsync(GetExportArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string

The name of the export as it appears in the console or from list-exports

Name string

The name of the export as it appears in the console or from list-exports

name string

The name of the export as it appears in the console or from list-exports

name str

The name of the export as it appears in the console or from list-exports

GetExport Result

The following output properties are available:

ExportingStackId string

The exporting_stack_id (AWS ARNs) equivalent ExportingStackId from list-exports

Id string

The provider-assigned unique ID for this managed resource.

Name string
Value string

The value from Cloudformation export identified by the export name found from list-exports

ExportingStackId string

The exporting_stack_id (AWS ARNs) equivalent ExportingStackId from list-exports

Id string

The provider-assigned unique ID for this managed resource.

Name string
Value string

The value from Cloudformation export identified by the export name found from list-exports

exportingStackId string

The exporting_stack_id (AWS ARNs) equivalent ExportingStackId from list-exports

id string

The provider-assigned unique ID for this managed resource.

name string
value string

The value from Cloudformation export identified by the export name found from list-exports

exporting_stack_id str

The exporting_stack_id (AWS ARNs) equivalent ExportingStackId from list-exports

id str

The provider-assigned unique ID for this managed resource.

name str
value str

The value from Cloudformation export identified by the export name found from list-exports

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.