Skip to main content

transit_gateway_vpc_attachments

Creates, updates, deletes, gets or lists a transit_gateway_vpc_attachments resource.

Overview

Nametransit_gateway_vpc_attachments
TypeResource
Idaws.ec2.transit_gateway_vpc_attachments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
creation_timestringThe creation time.
optionsstringThe VPC attachment options.
statestringThe state of the VPC attachment. Note that the initiating state has been deprecated.
subnet_idsstringThe IDs of the subnets.
tagsstringThe tags for the VPC attachment.
transit_gateway_attachment_idstringThe ID of the attachment.
transit_gateway_idstringThe ID of the transit gateway.
vpc_idstringThe ID of the VPC.
vpc_owner_idstringThe ID of the Amazon Web Services account that owns the VPC.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_transit_gateway_vpc_attachmentsselectregionTransitGatewayAttachmentIds, Filter, MaxResults, NextToken, DryRunDescribes one or more VPC attachments. By default, all VPC attachments are described. Alternatively, you can filter the results.
create_transit_gateway_vpc_attachmentinsertTransitGatewayId, VpcId, SubnetIds, regionOptions, TagSpecifications, DryRunAttaches the specified VPC to the specified transit gateway. If you attach a VPC with a CIDR range that overlaps the CIDR range of a VPC that is already attached, the new VPC CIDR range is not propagated to the default propagation route table. To send VPC traffic to an attached transit gateway, add a route to the VPC route table using CreateRoute.
modify_transit_gateway_vpc_attachmentupdateTransitGatewayAttachmentId, regionAddSubnetIds, RemoveSubnetIds, Options, DryRunModifies the specified VPC attachment.
delete_transit_gateway_vpc_attachmentdeleteTransitGatewayAttachmentId, regionDryRunDeletes the specified VPC attachment.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
SubnetIdsarrayThe IDs of one or more subnets. You can specify only one subnet per Availability Zone. You must specify at least one subnet, but we recommend that you specify two subnets for better availability. The transit gateway uses one IP address from each specified subnet.
TransitGatewayAttachmentIdstringThe ID of the attachment.
TransitGatewayIdstringThe ID of the transit gateway.
VpcIdstringThe ID of the VPC.
regionstringAWS region (default: us-east-1)
AddSubnetIdsarrayThe IDs of one or more subnets to add. You can specify at most one subnet per Availability Zone.
DryRunbooleanChecks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
FilterarrayOne or more filters. The possible values are: state - The state of the attachment. Valid values are available | deleted | deleting | failed | failing | initiatingRequest | modifying | pendingAcceptance | pending | rollingBack | rejected | rejecting. transit-gateway-attachment-id - The ID of the attachment. transit-gateway-id - The ID of the transit gateway. vpc-id - The ID of the VPC.
MaxResultsintegerThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
NextTokenstringThe token for the next page of results.
OptionsobjectThe new VPC attachment options.
RemoveSubnetIdsarrayThe IDs of one or more subnets to remove.
TagSpecificationsarrayThe tags to apply to the VPC attachment.
TransitGatewayAttachmentIdsarrayThe IDs of the attachments.

SELECT examples

Describes one or more VPC attachments. By default, all VPC attachments are described. Alternatively, you can filter the results.

SELECT
creation_time,
options,
state,
subnet_ids,
tags,
transit_gateway_attachment_id,
transit_gateway_id,
vpc_id,
vpc_owner_id
FROM aws.ec2.transit_gateway_vpc_attachments
WHERE region = '{{ region }}' -- required
AND TransitGatewayAttachmentIds = '{{ TransitGatewayAttachmentIds }}'
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND DryRun = '{{ DryRun }}'
;

INSERT examples

Attaches the specified VPC to the specified transit gateway. If you attach a VPC with a CIDR range that overlaps the CIDR range of a VPC that is already attached, the new VPC CIDR range is not propagated to the default propagation route table. To send VPC traffic to an attached transit gateway, add a route to the VPC route table using CreateRoute.

INSERT INTO aws.ec2.transit_gateway_vpc_attachments (
TransitGatewayId,
VpcId,
SubnetIds,
region,
Options,
TagSpecifications,
DryRun
)
SELECT
'{{ TransitGatewayId }}',
'{{ VpcId }}',
'{{ SubnetIds }}',
'{{ region }}',
'{{ Options }}',
'{{ TagSpecifications }}',
'{{ DryRun }}'
RETURNING
creation_time,
options,
state,
subnet_ids,
tags,
transit_gateway_attachment_id,
transit_gateway_id,
vpc_id,
vpc_owner_id
;

UPDATE examples

Modifies the specified VPC attachment.

UPDATE aws.ec2.transit_gateway_vpc_attachments
SET
-- No updatable properties
WHERE
TransitGatewayAttachmentId = '{{ TransitGatewayAttachmentId }}' --required
AND region = '{{ region }}' --required
AND AddSubnetIds = '{{ AddSubnetIds}}'
AND RemoveSubnetIds = '{{ RemoveSubnetIds}}'
AND Options = '{{ Options}}'
AND DryRun = {{ DryRun}}
RETURNING
creation_time,
options,
state,
subnet_ids,
tags,
transit_gateway_attachment_id,
transit_gateway_id,
vpc_id,
vpc_owner_id;

DELETE examples

Deletes the specified VPC attachment.

DELETE FROM aws.ec2.transit_gateway_vpc_attachments
WHERE TransitGatewayAttachmentId = '{{ TransitGatewayAttachmentId }}' --required
AND region = '{{ region }}' --required
AND DryRun = '{{ DryRun }}'
;