1. Packages
  2. AWS Classic
  3. API Docs
  4. directconnect
  5. GatewayAssociation

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.directconnect.GatewayAssociation

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Associates a Direct Connect Gateway with a VGW or transit gateway.

    To create a cross-account association, create an aws.directconnect.GatewayAssociationProposal resource in the AWS account that owns the VGW or transit gateway and then accept the proposal in the AWS account that owns the Direct Connect Gateway by creating an aws.directconnect.GatewayAssociation resource with the proposal_id and associated_gateway_owner_account_id attributes set.

    Example Usage

    VPN Gateway Association

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.directconnect.Gateway("example", {
        name: "example",
        amazonSideAsn: "64512",
    });
    const exampleVpc = new aws.ec2.Vpc("example", {cidrBlock: "10.255.255.0/28"});
    const exampleVpnGateway = new aws.ec2.VpnGateway("example", {vpcId: exampleVpc.id});
    const exampleGatewayAssociation = new aws.directconnect.GatewayAssociation("example", {
        dxGatewayId: example.id,
        associatedGatewayId: exampleVpnGateway.id,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.directconnect.Gateway("example",
        name="example",
        amazon_side_asn="64512")
    example_vpc = aws.ec2.Vpc("example", cidr_block="10.255.255.0/28")
    example_vpn_gateway = aws.ec2.VpnGateway("example", vpc_id=example_vpc.id)
    example_gateway_association = aws.directconnect.GatewayAssociation("example",
        dx_gateway_id=example.id,
        associated_gateway_id=example_vpn_gateway.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/directconnect"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := directconnect.NewGateway(ctx, "example", &directconnect.GatewayArgs{
    			Name:          pulumi.String("example"),
    			AmazonSideAsn: pulumi.String("64512"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleVpc, err := ec2.NewVpc(ctx, "example", &ec2.VpcArgs{
    			CidrBlock: pulumi.String("10.255.255.0/28"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleVpnGateway, err := ec2.NewVpnGateway(ctx, "example", &ec2.VpnGatewayArgs{
    			VpcId: exampleVpc.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = directconnect.NewGatewayAssociation(ctx, "example", &directconnect.GatewayAssociationArgs{
    			DxGatewayId:         example.ID(),
    			AssociatedGatewayId: exampleVpnGateway.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.DirectConnect.Gateway("example", new()
        {
            Name = "example",
            AmazonSideAsn = "64512",
        });
    
        var exampleVpc = new Aws.Ec2.Vpc("example", new()
        {
            CidrBlock = "10.255.255.0/28",
        });
    
        var exampleVpnGateway = new Aws.Ec2.VpnGateway("example", new()
        {
            VpcId = exampleVpc.Id,
        });
    
        var exampleGatewayAssociation = new Aws.DirectConnect.GatewayAssociation("example", new()
        {
            DxGatewayId = example.Id,
            AssociatedGatewayId = exampleVpnGateway.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.directconnect.Gateway;
    import com.pulumi.aws.directconnect.GatewayArgs;
    import com.pulumi.aws.ec2.Vpc;
    import com.pulumi.aws.ec2.VpcArgs;
    import com.pulumi.aws.ec2.VpnGateway;
    import com.pulumi.aws.ec2.VpnGatewayArgs;
    import com.pulumi.aws.directconnect.GatewayAssociation;
    import com.pulumi.aws.directconnect.GatewayAssociationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new Gateway("example", GatewayArgs.builder()
                .name("example")
                .amazonSideAsn("64512")
                .build());
    
            var exampleVpc = new Vpc("exampleVpc", VpcArgs.builder()
                .cidrBlock("10.255.255.0/28")
                .build());
    
            var exampleVpnGateway = new VpnGateway("exampleVpnGateway", VpnGatewayArgs.builder()
                .vpcId(exampleVpc.id())
                .build());
    
            var exampleGatewayAssociation = new GatewayAssociation("exampleGatewayAssociation", GatewayAssociationArgs.builder()
                .dxGatewayId(example.id())
                .associatedGatewayId(exampleVpnGateway.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:directconnect:Gateway
        properties:
          name: example
          amazonSideAsn: '64512'
      exampleVpc:
        type: aws:ec2:Vpc
        name: example
        properties:
          cidrBlock: 10.255.255.0/28
      exampleVpnGateway:
        type: aws:ec2:VpnGateway
        name: example
        properties:
          vpcId: ${exampleVpc.id}
      exampleGatewayAssociation:
        type: aws:directconnect:GatewayAssociation
        name: example
        properties:
          dxGatewayId: ${example.id}
          associatedGatewayId: ${exampleVpnGateway.id}
    

    Transit Gateway Association

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.directconnect.Gateway("example", {
        name: "example",
        amazonSideAsn: "64512",
    });
    const exampleTransitGateway = new aws.ec2transitgateway.TransitGateway("example", {});
    const exampleGatewayAssociation = new aws.directconnect.GatewayAssociation("example", {
        dxGatewayId: example.id,
        associatedGatewayId: exampleTransitGateway.id,
        allowedPrefixes: [
            "10.255.255.0/30",
            "10.255.255.8/30",
        ],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.directconnect.Gateway("example",
        name="example",
        amazon_side_asn="64512")
    example_transit_gateway = aws.ec2transitgateway.TransitGateway("example")
    example_gateway_association = aws.directconnect.GatewayAssociation("example",
        dx_gateway_id=example.id,
        associated_gateway_id=example_transit_gateway.id,
        allowed_prefixes=[
            "10.255.255.0/30",
            "10.255.255.8/30",
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/directconnect"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := directconnect.NewGateway(ctx, "example", &directconnect.GatewayArgs{
    			Name:          pulumi.String("example"),
    			AmazonSideAsn: pulumi.String("64512"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleTransitGateway, err := ec2transitgateway.NewTransitGateway(ctx, "example", nil)
    		if err != nil {
    			return err
    		}
    		_, err = directconnect.NewGatewayAssociation(ctx, "example", &directconnect.GatewayAssociationArgs{
    			DxGatewayId:         example.ID(),
    			AssociatedGatewayId: exampleTransitGateway.ID(),
    			AllowedPrefixes: pulumi.StringArray{
    				pulumi.String("10.255.255.0/30"),
    				pulumi.String("10.255.255.8/30"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.DirectConnect.Gateway("example", new()
        {
            Name = "example",
            AmazonSideAsn = "64512",
        });
    
        var exampleTransitGateway = new Aws.Ec2TransitGateway.TransitGateway("example");
    
        var exampleGatewayAssociation = new Aws.DirectConnect.GatewayAssociation("example", new()
        {
            DxGatewayId = example.Id,
            AssociatedGatewayId = exampleTransitGateway.Id,
            AllowedPrefixes = new[]
            {
                "10.255.255.0/30",
                "10.255.255.8/30",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.directconnect.Gateway;
    import com.pulumi.aws.directconnect.GatewayArgs;
    import com.pulumi.aws.ec2transitgateway.TransitGateway;
    import com.pulumi.aws.directconnect.GatewayAssociation;
    import com.pulumi.aws.directconnect.GatewayAssociationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new Gateway("example", GatewayArgs.builder()
                .name("example")
                .amazonSideAsn("64512")
                .build());
    
            var exampleTransitGateway = new TransitGateway("exampleTransitGateway");
    
            var exampleGatewayAssociation = new GatewayAssociation("exampleGatewayAssociation", GatewayAssociationArgs.builder()
                .dxGatewayId(example.id())
                .associatedGatewayId(exampleTransitGateway.id())
                .allowedPrefixes(            
                    "10.255.255.0/30",
                    "10.255.255.8/30")
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:directconnect:Gateway
        properties:
          name: example
          amazonSideAsn: '64512'
      exampleTransitGateway:
        type: aws:ec2transitgateway:TransitGateway
        name: example
      exampleGatewayAssociation:
        type: aws:directconnect:GatewayAssociation
        name: example
        properties:
          dxGatewayId: ${example.id}
          associatedGatewayId: ${exampleTransitGateway.id}
          allowedPrefixes:
            - 10.255.255.0/30
            - 10.255.255.8/30
    

    Allowed Prefixes

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.directconnect.Gateway("example", {
        name: "example",
        amazonSideAsn: "64512",
    });
    const exampleVpc = new aws.ec2.Vpc("example", {cidrBlock: "10.255.255.0/28"});
    const exampleVpnGateway = new aws.ec2.VpnGateway("example", {vpcId: exampleVpc.id});
    const exampleGatewayAssociation = new aws.directconnect.GatewayAssociation("example", {
        dxGatewayId: example.id,
        associatedGatewayId: exampleVpnGateway.id,
        allowedPrefixes: [
            "210.52.109.0/24",
            "175.45.176.0/22",
        ],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.directconnect.Gateway("example",
        name="example",
        amazon_side_asn="64512")
    example_vpc = aws.ec2.Vpc("example", cidr_block="10.255.255.0/28")
    example_vpn_gateway = aws.ec2.VpnGateway("example", vpc_id=example_vpc.id)
    example_gateway_association = aws.directconnect.GatewayAssociation("example",
        dx_gateway_id=example.id,
        associated_gateway_id=example_vpn_gateway.id,
        allowed_prefixes=[
            "210.52.109.0/24",
            "175.45.176.0/22",
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/directconnect"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := directconnect.NewGateway(ctx, "example", &directconnect.GatewayArgs{
    			Name:          pulumi.String("example"),
    			AmazonSideAsn: pulumi.String("64512"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleVpc, err := ec2.NewVpc(ctx, "example", &ec2.VpcArgs{
    			CidrBlock: pulumi.String("10.255.255.0/28"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleVpnGateway, err := ec2.NewVpnGateway(ctx, "example", &ec2.VpnGatewayArgs{
    			VpcId: exampleVpc.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = directconnect.NewGatewayAssociation(ctx, "example", &directconnect.GatewayAssociationArgs{
    			DxGatewayId:         example.ID(),
    			AssociatedGatewayId: exampleVpnGateway.ID(),
    			AllowedPrefixes: pulumi.StringArray{
    				pulumi.String("210.52.109.0/24"),
    				pulumi.String("175.45.176.0/22"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.DirectConnect.Gateway("example", new()
        {
            Name = "example",
            AmazonSideAsn = "64512",
        });
    
        var exampleVpc = new Aws.Ec2.Vpc("example", new()
        {
            CidrBlock = "10.255.255.0/28",
        });
    
        var exampleVpnGateway = new Aws.Ec2.VpnGateway("example", new()
        {
            VpcId = exampleVpc.Id,
        });
    
        var exampleGatewayAssociation = new Aws.DirectConnect.GatewayAssociation("example", new()
        {
            DxGatewayId = example.Id,
            AssociatedGatewayId = exampleVpnGateway.Id,
            AllowedPrefixes = new[]
            {
                "210.52.109.0/24",
                "175.45.176.0/22",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.directconnect.Gateway;
    import com.pulumi.aws.directconnect.GatewayArgs;
    import com.pulumi.aws.ec2.Vpc;
    import com.pulumi.aws.ec2.VpcArgs;
    import com.pulumi.aws.ec2.VpnGateway;
    import com.pulumi.aws.ec2.VpnGatewayArgs;
    import com.pulumi.aws.directconnect.GatewayAssociation;
    import com.pulumi.aws.directconnect.GatewayAssociationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new Gateway("example", GatewayArgs.builder()
                .name("example")
                .amazonSideAsn("64512")
                .build());
    
            var exampleVpc = new Vpc("exampleVpc", VpcArgs.builder()
                .cidrBlock("10.255.255.0/28")
                .build());
    
            var exampleVpnGateway = new VpnGateway("exampleVpnGateway", VpnGatewayArgs.builder()
                .vpcId(exampleVpc.id())
                .build());
    
            var exampleGatewayAssociation = new GatewayAssociation("exampleGatewayAssociation", GatewayAssociationArgs.builder()
                .dxGatewayId(example.id())
                .associatedGatewayId(exampleVpnGateway.id())
                .allowedPrefixes(            
                    "210.52.109.0/24",
                    "175.45.176.0/22")
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:directconnect:Gateway
        properties:
          name: example
          amazonSideAsn: '64512'
      exampleVpc:
        type: aws:ec2:Vpc
        name: example
        properties:
          cidrBlock: 10.255.255.0/28
      exampleVpnGateway:
        type: aws:ec2:VpnGateway
        name: example
        properties:
          vpcId: ${exampleVpc.id}
      exampleGatewayAssociation:
        type: aws:directconnect:GatewayAssociation
        name: example
        properties:
          dxGatewayId: ${example.id}
          associatedGatewayId: ${exampleVpnGateway.id}
          allowedPrefixes:
            - 210.52.109.0/24
            - 175.45.176.0/22
    

    Create GatewayAssociation Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new GatewayAssociation(name: string, args: GatewayAssociationArgs, opts?: CustomResourceOptions);
    @overload
    def GatewayAssociation(resource_name: str,
                           args: GatewayAssociationArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def GatewayAssociation(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           dx_gateway_id: Optional[str] = None,
                           allowed_prefixes: Optional[Sequence[str]] = None,
                           associated_gateway_id: Optional[str] = None,
                           associated_gateway_owner_account_id: Optional[str] = None,
                           proposal_id: Optional[str] = None,
                           vpn_gateway_id: Optional[str] = None)
    func NewGatewayAssociation(ctx *Context, name string, args GatewayAssociationArgs, opts ...ResourceOption) (*GatewayAssociation, error)
    public GatewayAssociation(string name, GatewayAssociationArgs args, CustomResourceOptions? opts = null)
    public GatewayAssociation(String name, GatewayAssociationArgs args)
    public GatewayAssociation(String name, GatewayAssociationArgs args, CustomResourceOptions options)
    
    type: aws:directconnect:GatewayAssociation
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args GatewayAssociationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args GatewayAssociationArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args GatewayAssociationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GatewayAssociationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GatewayAssociationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var gatewayAssociationResource = new Aws.DirectConnect.GatewayAssociation("gatewayAssociationResource", new()
    {
        DxGatewayId = "string",
        AllowedPrefixes = new[]
        {
            "string",
        },
        AssociatedGatewayId = "string",
        AssociatedGatewayOwnerAccountId = "string",
        ProposalId = "string",
    });
    
    example, err := directconnect.NewGatewayAssociation(ctx, "gatewayAssociationResource", &directconnect.GatewayAssociationArgs{
    	DxGatewayId: pulumi.String("string"),
    	AllowedPrefixes: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	AssociatedGatewayId:             pulumi.String("string"),
    	AssociatedGatewayOwnerAccountId: pulumi.String("string"),
    	ProposalId:                      pulumi.String("string"),
    })
    
    var gatewayAssociationResource = new GatewayAssociation("gatewayAssociationResource", GatewayAssociationArgs.builder()
        .dxGatewayId("string")
        .allowedPrefixes("string")
        .associatedGatewayId("string")
        .associatedGatewayOwnerAccountId("string")
        .proposalId("string")
        .build());
    
    gateway_association_resource = aws.directconnect.GatewayAssociation("gatewayAssociationResource",
        dx_gateway_id="string",
        allowed_prefixes=["string"],
        associated_gateway_id="string",
        associated_gateway_owner_account_id="string",
        proposal_id="string")
    
    const gatewayAssociationResource = new aws.directconnect.GatewayAssociation("gatewayAssociationResource", {
        dxGatewayId: "string",
        allowedPrefixes: ["string"],
        associatedGatewayId: "string",
        associatedGatewayOwnerAccountId: "string",
        proposalId: "string",
    });
    
    type: aws:directconnect:GatewayAssociation
    properties:
        allowedPrefixes:
            - string
        associatedGatewayId: string
        associatedGatewayOwnerAccountId: string
        dxGatewayId: string
        proposalId: string
    

    GatewayAssociation Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The GatewayAssociation resource accepts the following input properties:

    DxGatewayId string
    The ID of the Direct Connect gateway.
    AllowedPrefixes List<string>
    VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
    AssociatedGatewayId string
    The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. Used for single account Direct Connect gateway associations.
    AssociatedGatewayOwnerAccountId string
    The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway. Used for cross-account Direct Connect gateway associations.
    ProposalId string
    The ID of the Direct Connect gateway association proposal. Used for cross-account Direct Connect gateway associations.
    VpnGatewayId string

    Deprecated: use 'associated_gateway_id' argument instead

    DxGatewayId string
    The ID of the Direct Connect gateway.
    AllowedPrefixes []string
    VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
    AssociatedGatewayId string
    The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. Used for single account Direct Connect gateway associations.
    AssociatedGatewayOwnerAccountId string
    The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway. Used for cross-account Direct Connect gateway associations.
    ProposalId string
    The ID of the Direct Connect gateway association proposal. Used for cross-account Direct Connect gateway associations.
    VpnGatewayId string

    Deprecated: use 'associated_gateway_id' argument instead

    dxGatewayId String
    The ID of the Direct Connect gateway.
    allowedPrefixes List<String>
    VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
    associatedGatewayId String
    The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. Used for single account Direct Connect gateway associations.
    associatedGatewayOwnerAccountId String
    The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway. Used for cross-account Direct Connect gateway associations.
    proposalId String
    The ID of the Direct Connect gateway association proposal. Used for cross-account Direct Connect gateway associations.
    vpnGatewayId String

    Deprecated: use 'associated_gateway_id' argument instead

    dxGatewayId string
    The ID of the Direct Connect gateway.
    allowedPrefixes string[]
    VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
    associatedGatewayId string
    The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. Used for single account Direct Connect gateway associations.
    associatedGatewayOwnerAccountId string
    The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway. Used for cross-account Direct Connect gateway associations.
    proposalId string
    The ID of the Direct Connect gateway association proposal. Used for cross-account Direct Connect gateway associations.
    vpnGatewayId string

    Deprecated: use 'associated_gateway_id' argument instead

    dx_gateway_id str
    The ID of the Direct Connect gateway.
    allowed_prefixes Sequence[str]
    VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
    associated_gateway_id str
    The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. Used for single account Direct Connect gateway associations.
    associated_gateway_owner_account_id str
    The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway. Used for cross-account Direct Connect gateway associations.
    proposal_id str
    The ID of the Direct Connect gateway association proposal. Used for cross-account Direct Connect gateway associations.
    vpn_gateway_id str

    Deprecated: use 'associated_gateway_id' argument instead

    dxGatewayId String
    The ID of the Direct Connect gateway.
    allowedPrefixes List<String>
    VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
    associatedGatewayId String
    The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. Used for single account Direct Connect gateway associations.
    associatedGatewayOwnerAccountId String
    The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway. Used for cross-account Direct Connect gateway associations.
    proposalId String
    The ID of the Direct Connect gateway association proposal. Used for cross-account Direct Connect gateway associations.
    vpnGatewayId String

    Deprecated: use 'associated_gateway_id' argument instead

    Outputs

    All input properties are implicitly available as output properties. Additionally, the GatewayAssociation resource produces the following output properties:

    AssociatedGatewayType string
    The type of the associated gateway, transitGateway or virtualPrivateGateway.
    DxGatewayAssociationId string
    The ID of the Direct Connect gateway association.
    DxGatewayOwnerAccountId string
    The ID of the AWS account that owns the Direct Connect gateway.
    Id string
    The provider-assigned unique ID for this managed resource.
    AssociatedGatewayType string
    The type of the associated gateway, transitGateway or virtualPrivateGateway.
    DxGatewayAssociationId string
    The ID of the Direct Connect gateway association.
    DxGatewayOwnerAccountId string
    The ID of the AWS account that owns the Direct Connect gateway.
    Id string
    The provider-assigned unique ID for this managed resource.
    associatedGatewayType String
    The type of the associated gateway, transitGateway or virtualPrivateGateway.
    dxGatewayAssociationId String
    The ID of the Direct Connect gateway association.
    dxGatewayOwnerAccountId String
    The ID of the AWS account that owns the Direct Connect gateway.
    id String
    The provider-assigned unique ID for this managed resource.
    associatedGatewayType string
    The type of the associated gateway, transitGateway or virtualPrivateGateway.
    dxGatewayAssociationId string
    The ID of the Direct Connect gateway association.
    dxGatewayOwnerAccountId string
    The ID of the AWS account that owns the Direct Connect gateway.
    id string
    The provider-assigned unique ID for this managed resource.
    associated_gateway_type str
    The type of the associated gateway, transitGateway or virtualPrivateGateway.
    dx_gateway_association_id str
    The ID of the Direct Connect gateway association.
    dx_gateway_owner_account_id str
    The ID of the AWS account that owns the Direct Connect gateway.
    id str
    The provider-assigned unique ID for this managed resource.
    associatedGatewayType String
    The type of the associated gateway, transitGateway or virtualPrivateGateway.
    dxGatewayAssociationId String
    The ID of the Direct Connect gateway association.
    dxGatewayOwnerAccountId String
    The ID of the AWS account that owns the Direct Connect gateway.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing GatewayAssociation Resource

    Get an existing GatewayAssociation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: GatewayAssociationState, opts?: CustomResourceOptions): GatewayAssociation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            allowed_prefixes: Optional[Sequence[str]] = None,
            associated_gateway_id: Optional[str] = None,
            associated_gateway_owner_account_id: Optional[str] = None,
            associated_gateway_type: Optional[str] = None,
            dx_gateway_association_id: Optional[str] = None,
            dx_gateway_id: Optional[str] = None,
            dx_gateway_owner_account_id: Optional[str] = None,
            proposal_id: Optional[str] = None,
            vpn_gateway_id: Optional[str] = None) -> GatewayAssociation
    func GetGatewayAssociation(ctx *Context, name string, id IDInput, state *GatewayAssociationState, opts ...ResourceOption) (*GatewayAssociation, error)
    public static GatewayAssociation Get(string name, Input<string> id, GatewayAssociationState? state, CustomResourceOptions? opts = null)
    public static GatewayAssociation get(String name, Output<String> id, GatewayAssociationState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AllowedPrefixes List<string>
    VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
    AssociatedGatewayId string
    The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. Used for single account Direct Connect gateway associations.
    AssociatedGatewayOwnerAccountId string
    The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway. Used for cross-account Direct Connect gateway associations.
    AssociatedGatewayType string
    The type of the associated gateway, transitGateway or virtualPrivateGateway.
    DxGatewayAssociationId string
    The ID of the Direct Connect gateway association.
    DxGatewayId string
    The ID of the Direct Connect gateway.
    DxGatewayOwnerAccountId string
    The ID of the AWS account that owns the Direct Connect gateway.
    ProposalId string
    The ID of the Direct Connect gateway association proposal. Used for cross-account Direct Connect gateway associations.
    VpnGatewayId string

    Deprecated: use 'associated_gateway_id' argument instead

    AllowedPrefixes []string
    VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
    AssociatedGatewayId string
    The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. Used for single account Direct Connect gateway associations.
    AssociatedGatewayOwnerAccountId string
    The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway. Used for cross-account Direct Connect gateway associations.
    AssociatedGatewayType string
    The type of the associated gateway, transitGateway or virtualPrivateGateway.
    DxGatewayAssociationId string
    The ID of the Direct Connect gateway association.
    DxGatewayId string
    The ID of the Direct Connect gateway.
    DxGatewayOwnerAccountId string
    The ID of the AWS account that owns the Direct Connect gateway.
    ProposalId string
    The ID of the Direct Connect gateway association proposal. Used for cross-account Direct Connect gateway associations.
    VpnGatewayId string

    Deprecated: use 'associated_gateway_id' argument instead

    allowedPrefixes List<String>
    VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
    associatedGatewayId String
    The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. Used for single account Direct Connect gateway associations.
    associatedGatewayOwnerAccountId String
    The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway. Used for cross-account Direct Connect gateway associations.
    associatedGatewayType String
    The type of the associated gateway, transitGateway or virtualPrivateGateway.
    dxGatewayAssociationId String
    The ID of the Direct Connect gateway association.
    dxGatewayId String
    The ID of the Direct Connect gateway.
    dxGatewayOwnerAccountId String
    The ID of the AWS account that owns the Direct Connect gateway.
    proposalId String
    The ID of the Direct Connect gateway association proposal. Used for cross-account Direct Connect gateway associations.
    vpnGatewayId String

    Deprecated: use 'associated_gateway_id' argument instead

    allowedPrefixes string[]
    VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
    associatedGatewayId string
    The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. Used for single account Direct Connect gateway associations.
    associatedGatewayOwnerAccountId string
    The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway. Used for cross-account Direct Connect gateway associations.
    associatedGatewayType string
    The type of the associated gateway, transitGateway or virtualPrivateGateway.
    dxGatewayAssociationId string
    The ID of the Direct Connect gateway association.
    dxGatewayId string
    The ID of the Direct Connect gateway.
    dxGatewayOwnerAccountId string
    The ID of the AWS account that owns the Direct Connect gateway.
    proposalId string
    The ID of the Direct Connect gateway association proposal. Used for cross-account Direct Connect gateway associations.
    vpnGatewayId string

    Deprecated: use 'associated_gateway_id' argument instead

    allowed_prefixes Sequence[str]
    VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
    associated_gateway_id str
    The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. Used for single account Direct Connect gateway associations.
    associated_gateway_owner_account_id str
    The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway. Used for cross-account Direct Connect gateway associations.
    associated_gateway_type str
    The type of the associated gateway, transitGateway or virtualPrivateGateway.
    dx_gateway_association_id str
    The ID of the Direct Connect gateway association.
    dx_gateway_id str
    The ID of the Direct Connect gateway.
    dx_gateway_owner_account_id str
    The ID of the AWS account that owns the Direct Connect gateway.
    proposal_id str
    The ID of the Direct Connect gateway association proposal. Used for cross-account Direct Connect gateway associations.
    vpn_gateway_id str

    Deprecated: use 'associated_gateway_id' argument instead

    allowedPrefixes List<String>
    VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
    associatedGatewayId String
    The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. Used for single account Direct Connect gateway associations.
    associatedGatewayOwnerAccountId String
    The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway. Used for cross-account Direct Connect gateway associations.
    associatedGatewayType String
    The type of the associated gateway, transitGateway or virtualPrivateGateway.
    dxGatewayAssociationId String
    The ID of the Direct Connect gateway association.
    dxGatewayId String
    The ID of the Direct Connect gateway.
    dxGatewayOwnerAccountId String
    The ID of the AWS account that owns the Direct Connect gateway.
    proposalId String
    The ID of the Direct Connect gateway association proposal. Used for cross-account Direct Connect gateway associations.
    vpnGatewayId String

    Deprecated: use 'associated_gateway_id' argument instead

    Import

    Using pulumi import, import Direct Connect gateway associations using dx_gateway_id together with associated_gateway_id. For example:

    $ pulumi import aws:directconnect/gatewayAssociation:GatewayAssociation example 345508c3-7215-4aef-9832-07c125d5bd0f/vgw-98765432
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi