1. Packages
  2. AWS
  3. API Docs
  4. directconnect
  5. GatewayAssociationProposal
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.directconnect.GatewayAssociationProposal

Explore with Pulumi AI

Manages a Direct Connect Gateway Association Proposal, typically for enabling cross-account associations. For single account associations, see the aws.directconnect.GatewayAssociation resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.directconnect.GatewayAssociationProposal("example", {
    dxGatewayId: exampleAwsDxGateway.id,
    dxGatewayOwnerAccountId: exampleAwsDxGateway.ownerAccountId,
    associatedGatewayId: exampleAwsVpnGateway.id,
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.directconnect.GatewayAssociationProposal("example",
    dx_gateway_id=example_aws_dx_gateway["id"],
    dx_gateway_owner_account_id=example_aws_dx_gateway["ownerAccountId"],
    associated_gateway_id=example_aws_vpn_gateway["id"])
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/directconnect"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := directconnect.NewGatewayAssociationProposal(ctx, "example", &directconnect.GatewayAssociationProposalArgs{
			DxGatewayId:             pulumi.Any(exampleAwsDxGateway.Id),
			DxGatewayOwnerAccountId: pulumi.Any(exampleAwsDxGateway.OwnerAccountId),
			AssociatedGatewayId:     pulumi.Any(exampleAwsVpnGateway.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.DirectConnect.GatewayAssociationProposal("example", new()
    {
        DxGatewayId = exampleAwsDxGateway.Id,
        DxGatewayOwnerAccountId = exampleAwsDxGateway.OwnerAccountId,
        AssociatedGatewayId = exampleAwsVpnGateway.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.directconnect.GatewayAssociationProposal;
import com.pulumi.aws.directconnect.GatewayAssociationProposalArgs;
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 GatewayAssociationProposal("example", GatewayAssociationProposalArgs.builder()
            .dxGatewayId(exampleAwsDxGateway.id())
            .dxGatewayOwnerAccountId(exampleAwsDxGateway.ownerAccountId())
            .associatedGatewayId(exampleAwsVpnGateway.id())
            .build());

    }
}
Copy
resources:
  example:
    type: aws:directconnect:GatewayAssociationProposal
    properties:
      dxGatewayId: ${exampleAwsDxGateway.id}
      dxGatewayOwnerAccountId: ${exampleAwsDxGateway.ownerAccountId}
      associatedGatewayId: ${exampleAwsVpnGateway.id}
Copy

Create GatewayAssociationProposal Resource

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

Constructor syntax

new GatewayAssociationProposal(name: string, args: GatewayAssociationProposalArgs, opts?: CustomResourceOptions);
@overload
def GatewayAssociationProposal(resource_name: str,
                               args: GatewayAssociationProposalArgs,
                               opts: Optional[ResourceOptions] = None)

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

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. GatewayAssociationProposalArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. GatewayAssociationProposalArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. GatewayAssociationProposalArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. GatewayAssociationProposalArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. GatewayAssociationProposalArgs
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 gatewayAssociationProposalResource = new Aws.DirectConnect.GatewayAssociationProposal("gatewayAssociationProposalResource", new()
{
    AssociatedGatewayId = "string",
    DxGatewayId = "string",
    DxGatewayOwnerAccountId = "string",
    AllowedPrefixes = new[]
    {
        "string",
    },
});
Copy
example, err := directconnect.NewGatewayAssociationProposal(ctx, "gatewayAssociationProposalResource", &directconnect.GatewayAssociationProposalArgs{
	AssociatedGatewayId:     pulumi.String("string"),
	DxGatewayId:             pulumi.String("string"),
	DxGatewayOwnerAccountId: pulumi.String("string"),
	AllowedPrefixes: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var gatewayAssociationProposalResource = new GatewayAssociationProposal("gatewayAssociationProposalResource", GatewayAssociationProposalArgs.builder()
    .associatedGatewayId("string")
    .dxGatewayId("string")
    .dxGatewayOwnerAccountId("string")
    .allowedPrefixes("string")
    .build());
Copy
gateway_association_proposal_resource = aws.directconnect.GatewayAssociationProposal("gatewayAssociationProposalResource",
    associated_gateway_id="string",
    dx_gateway_id="string",
    dx_gateway_owner_account_id="string",
    allowed_prefixes=["string"])
Copy
const gatewayAssociationProposalResource = new aws.directconnect.GatewayAssociationProposal("gatewayAssociationProposalResource", {
    associatedGatewayId: "string",
    dxGatewayId: "string",
    dxGatewayOwnerAccountId: "string",
    allowedPrefixes: ["string"],
});
Copy
type: aws:directconnect:GatewayAssociationProposal
properties:
    allowedPrefixes:
        - string
    associatedGatewayId: string
    dxGatewayId: string
    dxGatewayOwnerAccountId: string
Copy

GatewayAssociationProposal Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The GatewayAssociationProposal resource accepts the following input properties:

AssociatedGatewayId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
DxGatewayId
This property is required.
Changes to this property will trigger replacement.
string
Direct Connect Gateway identifier.
DxGatewayOwnerAccountId
This property is required.
Changes to this property will trigger replacement.
string
AWS Account identifier of the Direct Connect Gateway's owner.
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
This property is required.
Changes to this property will trigger replacement.
string
The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
DxGatewayId
This property is required.
Changes to this property will trigger replacement.
string
Direct Connect Gateway identifier.
DxGatewayOwnerAccountId
This property is required.
Changes to this property will trigger replacement.
string
AWS Account identifier of the Direct Connect Gateway's owner.
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
This property is required.
Changes to this property will trigger replacement.
String
The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
dxGatewayId
This property is required.
Changes to this property will trigger replacement.
String
Direct Connect Gateway identifier.
dxGatewayOwnerAccountId
This property is required.
Changes to this property will trigger replacement.
String
AWS Account identifier of the Direct Connect Gateway's owner.
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
This property is required.
Changes to this property will trigger replacement.
string
The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
dxGatewayId
This property is required.
Changes to this property will trigger replacement.
string
Direct Connect Gateway identifier.
dxGatewayOwnerAccountId
This property is required.
Changes to this property will trigger replacement.
string
AWS Account identifier of the Direct Connect Gateway's owner.
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.
associated_gateway_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
dx_gateway_id
This property is required.
Changes to this property will trigger replacement.
str
Direct Connect Gateway identifier.
dx_gateway_owner_account_id
This property is required.
Changes to this property will trigger replacement.
str
AWS Account identifier of the Direct Connect Gateway's owner.
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.
associatedGatewayId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
dxGatewayId
This property is required.
Changes to this property will trigger replacement.
String
Direct Connect Gateway identifier.
dxGatewayOwnerAccountId
This property is required.
Changes to this property will trigger replacement.
String
AWS Account identifier of the Direct Connect Gateway's owner.
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.

Outputs

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

AssociatedGatewayOwnerAccountId string
The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway.
AssociatedGatewayType string
The type of the associated gateway, transitGateway or virtualPrivateGateway.
Id string
The provider-assigned unique ID for this managed resource.
AssociatedGatewayOwnerAccountId string
The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway.
AssociatedGatewayType string
The type of the associated gateway, transitGateway or virtualPrivateGateway.
Id string
The provider-assigned unique ID for this managed resource.
associatedGatewayOwnerAccountId String
The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway.
associatedGatewayType String
The type of the associated gateway, transitGateway or virtualPrivateGateway.
id String
The provider-assigned unique ID for this managed resource.
associatedGatewayOwnerAccountId string
The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway.
associatedGatewayType string
The type of the associated gateway, transitGateway or virtualPrivateGateway.
id string
The provider-assigned unique ID for this managed resource.
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.
associated_gateway_type str
The type of the associated gateway, transitGateway or virtualPrivateGateway.
id str
The provider-assigned unique ID for this managed resource.
associatedGatewayOwnerAccountId String
The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway.
associatedGatewayType String
The type of the associated gateway, transitGateway or virtualPrivateGateway.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing GatewayAssociationProposal Resource

Get an existing GatewayAssociationProposal 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?: GatewayAssociationProposalState, opts?: CustomResourceOptions): GatewayAssociationProposal
@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_id: Optional[str] = None,
        dx_gateway_owner_account_id: Optional[str] = None) -> GatewayAssociationProposal
func GetGatewayAssociationProposal(ctx *Context, name string, id IDInput, state *GatewayAssociationProposalState, opts ...ResourceOption) (*GatewayAssociationProposal, error)
public static GatewayAssociationProposal Get(string name, Input<string> id, GatewayAssociationProposalState? state, CustomResourceOptions? opts = null)
public static GatewayAssociationProposal get(String name, Output<String> id, GatewayAssociationProposalState state, CustomResourceOptions options)
resources:  _:    type: aws:directconnect:GatewayAssociationProposal    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. string
The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
AssociatedGatewayOwnerAccountId string
The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway.
AssociatedGatewayType string
The type of the associated gateway, transitGateway or virtualPrivateGateway.
DxGatewayId Changes to this property will trigger replacement. string
Direct Connect Gateway identifier.
DxGatewayOwnerAccountId Changes to this property will trigger replacement. string
AWS Account identifier of the Direct Connect Gateway's owner.
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 Changes to this property will trigger replacement. string
The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
AssociatedGatewayOwnerAccountId string
The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway.
AssociatedGatewayType string
The type of the associated gateway, transitGateway or virtualPrivateGateway.
DxGatewayId Changes to this property will trigger replacement. string
Direct Connect Gateway identifier.
DxGatewayOwnerAccountId Changes to this property will trigger replacement. string
AWS Account identifier of the Direct Connect Gateway's owner.
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 Changes to this property will trigger replacement. String
The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
associatedGatewayOwnerAccountId String
The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway.
associatedGatewayType String
The type of the associated gateway, transitGateway or virtualPrivateGateway.
dxGatewayId Changes to this property will trigger replacement. String
Direct Connect Gateway identifier.
dxGatewayOwnerAccountId Changes to this property will trigger replacement. String
AWS Account identifier of the Direct Connect Gateway's owner.
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 Changes to this property will trigger replacement. string
The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
associatedGatewayOwnerAccountId string
The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway.
associatedGatewayType string
The type of the associated gateway, transitGateway or virtualPrivateGateway.
dxGatewayId Changes to this property will trigger replacement. string
Direct Connect Gateway identifier.
dxGatewayOwnerAccountId Changes to this property will trigger replacement. string
AWS Account identifier of the Direct Connect Gateway's owner.
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 Changes to this property will trigger replacement. str
The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
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.
associated_gateway_type str
The type of the associated gateway, transitGateway or virtualPrivateGateway.
dx_gateway_id Changes to this property will trigger replacement. str
Direct Connect Gateway identifier.
dx_gateway_owner_account_id Changes to this property will trigger replacement. str
AWS Account identifier of the Direct Connect Gateway's owner.
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 Changes to this property will trigger replacement. String
The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
associatedGatewayOwnerAccountId String
The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway.
associatedGatewayType String
The type of the associated gateway, transitGateway or virtualPrivateGateway.
dxGatewayId Changes to this property will trigger replacement. String
Direct Connect Gateway identifier.
dxGatewayOwnerAccountId Changes to this property will trigger replacement. String
AWS Account identifier of the Direct Connect Gateway's owner.

Import

Using a proposal ID, Direct Connect Gateway ID and associated gateway ID separated by /:

With pulumi import, import Direct Connect Gateway Association Proposals using either a proposal ID or proposal ID, Direct Connect Gateway ID and associated gateway ID separated by /. For example:

Using a proposal ID:

$ pulumi import aws:directconnect/gatewayAssociationProposal:GatewayAssociationProposal example ac90e981-b718-4364-872d-65478c84fafe
Copy

Using a proposal ID, Direct Connect Gateway ID and associated gateway ID separated by /:

$ pulumi import aws:directconnect/gatewayAssociationProposal:GatewayAssociationProposal example ac90e981-b718-4364-872d-65478c84fafe/abcd1234-dcba-5678-be23-cdef9876ab45/vgw-12345678
Copy

The latter case is useful when a previous proposal has been accepted and deleted by AWS. The aws_dx_gateway_association_proposal resource will then represent a pseudo-proposal for the same Direct Connect Gateway and associated gateway. If no previous proposal is available, use a tool like uuidgen to generate a new random pseudo-proposal ID.

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.