transit_gateway_vpc_attachments
Creates, updates, deletes, gets or lists a transit_gateway_vpc_attachments resource.
Overview
| Name | transit_gateway_vpc_attachments |
| Type | Resource |
| Id | aws.ec2.transit_gateway_vpc_attachments |
Fields
The following fields are returned by SELECT queries:
- describe_transit_gateway_vpc_attachments
| Name | Datatype | Description |
|---|---|---|
creation_time | string | The creation time. |
options | string | The VPC attachment options. |
state | string | The state of the VPC attachment. Note that the initiating state has been deprecated. |
subnet_ids | string | The IDs of the subnets. |
tags | string | The tags for the VPC attachment. |
transit_gateway_attachment_id | string | The ID of the attachment. |
transit_gateway_id | string | The ID of the transit gateway. |
vpc_id | string | The ID of the VPC. |
vpc_owner_id | string | The ID of the Amazon Web Services account that owns the VPC. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_transit_gateway_vpc_attachments | select | region | TransitGatewayAttachmentIds, Filter, MaxResults, NextToken, DryRun | Describes one or more VPC attachments. By default, all VPC attachments are described. Alternatively, you can filter the results. |
create_transit_gateway_vpc_attachment | insert | TransitGatewayId, VpcId, SubnetIds, region | Options, TagSpecifications, DryRun | 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. |
modify_transit_gateway_vpc_attachment | update | TransitGatewayAttachmentId, region | AddSubnetIds, RemoveSubnetIds, Options, DryRun | Modifies the specified VPC attachment. |
delete_transit_gateway_vpc_attachment | delete | TransitGatewayAttachmentId, region | DryRun | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
SubnetIds | array | The 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. |
TransitGatewayAttachmentId | string | The ID of the attachment. |
TransitGatewayId | string | The ID of the transit gateway. |
VpcId | string | The ID of the VPC. |
region | string | AWS region (default: us-east-1) |
AddSubnetIds | array | The IDs of one or more subnets to add. You can specify at most one subnet per Availability Zone. |
DryRun | boolean | Checks 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. |
Filter | array | One 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. |
MaxResults | integer | The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value. |
NextToken | string | The token for the next page of results. |
Options | object | The new VPC attachment options. |
RemoveSubnetIds | array | The IDs of one or more subnets to remove. |
TagSpecifications | array | The tags to apply to the VPC attachment. |
TransitGatewayAttachmentIds | array | The IDs of the attachments. |
SELECT examples
- describe_transit_gateway_vpc_attachments
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
- create_transit_gateway_vpc_attachment
- Manifest
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
;
# Description fields are for documentation purposes
- name: transit_gateway_vpc_attachments
props:
- name: TransitGatewayId
value: "{{ TransitGatewayId }}"
description: Required parameter for the transit_gateway_vpc_attachments resource.
- name: VpcId
value: "{{ VpcId }}"
description: Required parameter for the transit_gateway_vpc_attachments resource.
- name: SubnetIds
value: "{{ SubnetIds }}"
description: Required parameter for the transit_gateway_vpc_attachments resource.
- name: region
value: "{{ region }}"
description: Required parameter for the transit_gateway_vpc_attachments resource.
- name: Options
value: "{{ Options }}"
description: The VPC attachment options.
description: The VPC attachment options.
- name: TagSpecifications
value: "{{ TagSpecifications }}"
description: The tags to apply to the VPC attachment.
description: The tags to apply to the VPC attachment.
- name: DryRun
value: {{ DryRun }}
description: Checks 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.
description: Checks 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.
UPDATE examples
- modify_transit_gateway_vpc_attachment
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
- delete_transit_gateway_vpc_attachment
Deletes the specified VPC attachment.
DELETE FROM aws.ec2.transit_gateway_vpc_attachments
WHERE TransitGatewayAttachmentId = '{{ TransitGatewayAttachmentId }}' --required
AND region = '{{ region }}' --required
AND DryRun = '{{ DryRun }}'
;