GatewayAssociationArgs

data class GatewayAssociationArgs(val allowedPrefixes: Output<List<String>>? = null, val associatedGatewayId: Output<String>? = null, val associatedGatewayOwnerAccountId: Output<String>? = null, val dxGatewayId: Output<String>? = null, val proposalId: Output<String>? = null, val vpnGatewayId: Output<String>? = null) : ConvertibleToJava<GatewayAssociationArgs>

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

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 exampleGateway = new Gateway("exampleGateway", GatewayArgs.builder()
.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(exampleGateway.id())
.associatedGatewayId(exampleVpnGateway.id())
.build());
}
}

Transit Gateway Association

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 exampleGateway = new Gateway("exampleGateway", GatewayArgs.builder()
.amazonSideAsn("64512")
.build());
var exampleTransitGateway = new TransitGateway("exampleTransitGateway");
var exampleGatewayAssociation = new GatewayAssociation("exampleGatewayAssociation", GatewayAssociationArgs.builder()
.dxGatewayId(exampleGateway.id())
.associatedGatewayId(exampleTransitGateway.id())
.allowedPrefixes(
"10.255.255.0/30",
"10.255.255.8/30")
.build());
}
}

Allowed Prefixes

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 exampleGateway = new Gateway("exampleGateway", GatewayArgs.builder()
.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(exampleGateway.id())
.associatedGatewayId(exampleVpnGateway.id())
.allowedPrefixes(
"210.52.109.0/24",
"175.45.176.0/22")
.build());
}
}

Import

Direct Connect gateway associations can be imported using dx_gateway_id together with associated_gateway_id, e.g.,

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

Constructors

Link copied to clipboard
constructor(allowedPrefixes: Output<List<String>>? = null, associatedGatewayId: Output<String>? = null, associatedGatewayOwnerAccountId: Output<String>? = null, dxGatewayId: Output<String>? = null, proposalId: Output<String>? = null, vpnGatewayId: Output<String>? = null)

Properties

Link copied to clipboard
val allowedPrefixes: Output<List<String>>? = null

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.

Link copied to clipboard
val associatedGatewayId: Output<String>? = null

The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. Used for single account Direct Connect gateway associations.

Link copied to clipboard

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.

Link copied to clipboard
val dxGatewayId: Output<String>? = null

The ID of the Direct Connect gateway.

Link copied to clipboard
val proposalId: Output<String>? = null

The ID of the Direct Connect gateway association proposal. Used for cross-account Direct Connect gateway associations.

Link copied to clipboard
val vpnGatewayId: Output<String>? = null

Functions

Link copied to clipboard
open override fun toJava(): GatewayAssociationArgs