VpcAttachment
Manages an EC2 Transit Gateway VPC Attachment. For examples of custom route table association and propagation, see the EC2 Transit Gateway Networking Examples Guide.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.Ec2TransitGateway.VpcAttachment("example", new Aws.Ec2TransitGateway.VpcAttachmentArgs
{
SubnetIds =
{
aws_subnet.Example.Id,
},
TransitGatewayId = aws_ec2_transit_gateway.Example.Id,
VpcId = aws_vpc.Example.Id,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2transitgateway"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2transitgateway.NewVpcAttachment(ctx, "example", &ec2transitgateway.VpcAttachmentArgs{
SubnetIds: pulumi.StringArray{
pulumi.String(aws_subnet.Example.Id),
},
TransitGatewayId: pulumi.String(aws_ec2_transit_gateway.Example.Id),
VpcId: pulumi.String(aws_vpc.Example.Id),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
example = aws.ec2transitgateway.VpcAttachment("example",
subnet_ids=[aws_subnet["example"]["id"]],
transit_gateway_id=aws_ec2_transit_gateway["example"]["id"],
vpc_id=aws_vpc["example"]["id"])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ec2transitgateway.VpcAttachment("example", {
subnetIds: [aws_subnet_example.id],
transitGatewayId: aws_ec2_transit_gateway_example.id,
vpcId: aws_vpc_example.id,
});Create a VpcAttachment Resource
new VpcAttachment(name: string, args: VpcAttachmentArgs, opts?: CustomResourceOptions);def VpcAttachment(resource_name, opts=None, dns_support=None, ipv6_support=None, subnet_ids=None, tags=None, transit_gateway_default_route_table_association=None, transit_gateway_default_route_table_propagation=None, transit_gateway_id=None, vpc_id=None, __props__=None);func NewVpcAttachment(ctx *Context, name string, args VpcAttachmentArgs, opts ...ResourceOption) (*VpcAttachment, error)public VpcAttachment(string name, VpcAttachmentArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args VpcAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VpcAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
VpcAttachment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The VpcAttachment resource accepts the following input properties:
- Subnet
Ids List<string> Identifiers of EC2 Subnets.
- Transit
Gateway stringId Identifier of EC2 Transit Gateway.
- Vpc
Id string Identifier of EC2 VPC.
- Dns
Support string Whether DNS support is enabled. Valid values:
disable,enable. Default value:enable.- Ipv6Support string
Whether IPv6 support is enabled. Valid values:
disable,enable. Default value:disable.- Dictionary<string, string>
Key-value tags for the EC2 Transit Gateway VPC Attachment.
- Transit
Gateway boolDefault Route Table Association Boolean whether the VPC Attachment should be associated with the EC2 Transit Gateway association default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.- Transit
Gateway boolDefault Route Table Propagation Boolean whether the VPC Attachment should propagate routes with the EC2 Transit Gateway propagation default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.
- Subnet
Ids []string Identifiers of EC2 Subnets.
- Transit
Gateway stringId Identifier of EC2 Transit Gateway.
- Vpc
Id string Identifier of EC2 VPC.
- Dns
Support string Whether DNS support is enabled. Valid values:
disable,enable. Default value:enable.- Ipv6Support string
Whether IPv6 support is enabled. Valid values:
disable,enable. Default value:disable.- map[string]string
Key-value tags for the EC2 Transit Gateway VPC Attachment.
- Transit
Gateway boolDefault Route Table Association Boolean whether the VPC Attachment should be associated with the EC2 Transit Gateway association default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.- Transit
Gateway boolDefault Route Table Propagation Boolean whether the VPC Attachment should propagate routes with the EC2 Transit Gateway propagation default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.
- subnet
Ids string[] Identifiers of EC2 Subnets.
- transit
Gateway stringId Identifier of EC2 Transit Gateway.
- vpc
Id string Identifier of EC2 VPC.
- dns
Support string Whether DNS support is enabled. Valid values:
disable,enable. Default value:enable.- ipv6Support string
Whether IPv6 support is enabled. Valid values:
disable,enable. Default value:disable.- {[key: string]: string}
Key-value tags for the EC2 Transit Gateway VPC Attachment.
- transit
Gateway booleanDefault Route Table Association Boolean whether the VPC Attachment should be associated with the EC2 Transit Gateway association default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.- transit
Gateway booleanDefault Route Table Propagation Boolean whether the VPC Attachment should propagate routes with the EC2 Transit Gateway propagation default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.
- subnet_
ids List[str] Identifiers of EC2 Subnets.
- transit_
gateway_ strid Identifier of EC2 Transit Gateway.
- vpc_
id str Identifier of EC2 VPC.
- dns_
support str Whether DNS support is enabled. Valid values:
disable,enable. Default value:enable.- ipv6_
support str Whether IPv6 support is enabled. Valid values:
disable,enable. Default value:disable.- Dict[str, str]
Key-value tags for the EC2 Transit Gateway VPC Attachment.
- transit_
gateway_ booldefault_ route_ table_ association Boolean whether the VPC Attachment should be associated with the EC2 Transit Gateway association default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.- transit_
gateway_ booldefault_ route_ table_ propagation Boolean whether the VPC Attachment should propagate routes with the EC2 Transit Gateway propagation default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcAttachment resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Vpc
Owner stringId Identifier of the AWS account that owns the EC2 VPC.
- Id string
- The provider-assigned unique ID for this managed resource.
- Vpc
Owner stringId Identifier of the AWS account that owns the EC2 VPC.
- id string
- The provider-assigned unique ID for this managed resource.
- vpc
Owner stringId Identifier of the AWS account that owns the EC2 VPC.
- id str
- The provider-assigned unique ID for this managed resource.
- vpc_
owner_ strid Identifier of the AWS account that owns the EC2 VPC.
Look up an Existing VpcAttachment Resource
Get an existing VpcAttachment 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?: VpcAttachmentState, opts?: CustomResourceOptions): VpcAttachmentstatic get(resource_name, id, opts=None, dns_support=None, ipv6_support=None, subnet_ids=None, tags=None, transit_gateway_default_route_table_association=None, transit_gateway_default_route_table_propagation=None, transit_gateway_id=None, vpc_id=None, vpc_owner_id=None, __props__=None);func GetVpcAttachment(ctx *Context, name string, id IDInput, state *VpcAttachmentState, opts ...ResourceOption) (*VpcAttachment, error)public static VpcAttachment Get(string name, Input<string> id, VpcAttachmentState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Dns
Support string Whether DNS support is enabled. Valid values:
disable,enable. Default value:enable.- Ipv6Support string
Whether IPv6 support is enabled. Valid values:
disable,enable. Default value:disable.- Subnet
Ids List<string> Identifiers of EC2 Subnets.
- Dictionary<string, string>
Key-value tags for the EC2 Transit Gateway VPC Attachment.
- Transit
Gateway boolDefault Route Table Association Boolean whether the VPC Attachment should be associated with the EC2 Transit Gateway association default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.- Transit
Gateway boolDefault Route Table Propagation Boolean whether the VPC Attachment should propagate routes with the EC2 Transit Gateway propagation default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.- Transit
Gateway stringId Identifier of EC2 Transit Gateway.
- Vpc
Id string Identifier of EC2 VPC.
- Vpc
Owner stringId Identifier of the AWS account that owns the EC2 VPC.
- Dns
Support string Whether DNS support is enabled. Valid values:
disable,enable. Default value:enable.- Ipv6Support string
Whether IPv6 support is enabled. Valid values:
disable,enable. Default value:disable.- Subnet
Ids []string Identifiers of EC2 Subnets.
- map[string]string
Key-value tags for the EC2 Transit Gateway VPC Attachment.
- Transit
Gateway boolDefault Route Table Association Boolean whether the VPC Attachment should be associated with the EC2 Transit Gateway association default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.- Transit
Gateway boolDefault Route Table Propagation Boolean whether the VPC Attachment should propagate routes with the EC2 Transit Gateway propagation default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.- Transit
Gateway stringId Identifier of EC2 Transit Gateway.
- Vpc
Id string Identifier of EC2 VPC.
- Vpc
Owner stringId Identifier of the AWS account that owns the EC2 VPC.
- dns
Support string Whether DNS support is enabled. Valid values:
disable,enable. Default value:enable.- ipv6Support string
Whether IPv6 support is enabled. Valid values:
disable,enable. Default value:disable.- subnet
Ids string[] Identifiers of EC2 Subnets.
- {[key: string]: string}
Key-value tags for the EC2 Transit Gateway VPC Attachment.
- transit
Gateway booleanDefault Route Table Association Boolean whether the VPC Attachment should be associated with the EC2 Transit Gateway association default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.- transit
Gateway booleanDefault Route Table Propagation Boolean whether the VPC Attachment should propagate routes with the EC2 Transit Gateway propagation default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.- transit
Gateway stringId Identifier of EC2 Transit Gateway.
- vpc
Id string Identifier of EC2 VPC.
- vpc
Owner stringId Identifier of the AWS account that owns the EC2 VPC.
- dns_
support str Whether DNS support is enabled. Valid values:
disable,enable. Default value:enable.- ipv6_
support str Whether IPv6 support is enabled. Valid values:
disable,enable. Default value:disable.- subnet_
ids List[str] Identifiers of EC2 Subnets.
- Dict[str, str]
Key-value tags for the EC2 Transit Gateway VPC Attachment.
- transit_
gateway_ booldefault_ route_ table_ association Boolean whether the VPC Attachment should be associated with the EC2 Transit Gateway association default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.- transit_
gateway_ booldefault_ route_ table_ propagation Boolean whether the VPC Attachment should propagate routes with the EC2 Transit Gateway propagation default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value:
true.- transit_
gateway_ strid Identifier of EC2 Transit Gateway.
- vpc_
id str Identifier of EC2 VPC.
- vpc_
owner_ strid Identifier of the AWS account that owns the EC2 VPC.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.