Class GatewayAssociation
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
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var exampleGateway = new Aws.DirectConnect.Gateway("exampleGateway", new Aws.DirectConnect.GatewayArgs
{
AmazonSideAsn = "64512",
});
var exampleVpc = new Aws.Ec2.Vpc("exampleVpc", new Aws.Ec2.VpcArgs
{
CidrBlock = "10.255.255.0/28",
});
var exampleVpnGateway = new Aws.Ec2.VpnGateway("exampleVpnGateway", new Aws.Ec2.VpnGatewayArgs
{
VpcId = exampleVpc.Id,
});
var exampleGatewayAssociation = new Aws.DirectConnect.GatewayAssociation("exampleGatewayAssociation", new Aws.DirectConnect.GatewayAssociationArgs
{
AssociatedGatewayId = exampleVpnGateway.Id,
DxGatewayId = exampleGateway.Id,
});
}
}
Transit Gateway Association
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var exampleGateway = new Aws.DirectConnect.Gateway("exampleGateway", new Aws.DirectConnect.GatewayArgs
{
AmazonSideAsn = "64512",
});
var exampleTransitGateway = new Aws.Ec2TransitGateway.TransitGateway("exampleTransitGateway", new Aws.Ec2TransitGateway.TransitGatewayArgs
{
});
var exampleGatewayAssociation = new Aws.DirectConnect.GatewayAssociation("exampleGatewayAssociation", new Aws.DirectConnect.GatewayAssociationArgs
{
AllowedPrefixes =
{
"10.255.255.0/30",
"10.255.255.8/30",
},
AssociatedGatewayId = exampleTransitGateway.Id,
DxGatewayId = exampleGateway.Id,
});
}
}
Allowed Prefixes
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var exampleGateway = new Aws.DirectConnect.Gateway("exampleGateway", new Aws.DirectConnect.GatewayArgs
{
AmazonSideAsn = "64512",
});
var exampleVpc = new Aws.Ec2.Vpc("exampleVpc", new Aws.Ec2.VpcArgs
{
CidrBlock = "10.255.255.0/28",
});
var exampleVpnGateway = new Aws.Ec2.VpnGateway("exampleVpnGateway", new Aws.Ec2.VpnGatewayArgs
{
VpcId = exampleVpc.Id,
});
var exampleGatewayAssociation = new Aws.DirectConnect.GatewayAssociation("exampleGatewayAssociation", new Aws.DirectConnect.GatewayAssociationArgs
{
AllowedPrefixes =
{
"210.52.109.0/24",
"175.45.176.0/22",
},
AssociatedGatewayId = exampleVpnGateway.Id,
DxGatewayId = exampleGateway.Id,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.DirectConnect
Assembly: Pulumi.Aws.dll
Syntax
public class GatewayAssociation : CustomResource
Constructors
View SourceGatewayAssociation(String, GatewayAssociationArgs, CustomResourceOptions)
Create a GatewayAssociation resource with the given unique name, arguments, and options.
Declaration
public GatewayAssociation(string name, GatewayAssociationArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| GatewayAssociationArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAllowedPrefixes
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.
Declaration
public Output<ImmutableArray<string>> AllowedPrefixes { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
AssociatedGatewayId
The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. Used for single account Direct Connect gateway associations.
Declaration
public Output<string> AssociatedGatewayId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
AssociatedGatewayOwnerAccountId
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.
Declaration
public Output<string> AssociatedGatewayOwnerAccountId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
AssociatedGatewayType
The type of the associated gateway, transitGateway or virtualPrivateGateway.
Declaration
public Output<string> AssociatedGatewayType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DxGatewayAssociationId
The ID of the Direct Connect gateway association.
Declaration
public Output<string> DxGatewayAssociationId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DxGatewayId
The ID of the Direct Connect gateway.
Declaration
public Output<string> DxGatewayId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DxGatewayOwnerAccountId
The ID of the AWS account that owns the Direct Connect gateway.
Declaration
public Output<string> DxGatewayOwnerAccountId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ProposalId
The ID of the Direct Connect gateway association proposal. Used for cross-account Direct Connect gateway associations.
Declaration
public Output<string> ProposalId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VpnGatewayId
Deprecated: Use associated_gateway_id instead. The ID of the VGW with which to associate the gateway.
Used for single account Direct Connect gateway associations.
Declaration
public Output<string> VpnGatewayId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, GatewayAssociationState, CustomResourceOptions)
Get an existing GatewayAssociation resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static GatewayAssociation Get(string name, Input<string> id, GatewayAssociationState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| GatewayAssociationState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| GatewayAssociation |