vpc_peering_connections
Creates, updates, deletes, gets or lists a vpc_peering_connections resource.
Overview
| Name | vpc_peering_connections |
| Type | Resource |
| Id | aws.ec2.vpc_peering_connections |
Fields
The following fields are returned by SELECT queries:
- describe_vpc_peering_connections
| Name | Datatype | Description |
|---|---|---|
accepter_vpc_info | string | Information about the accepter VPC. CIDR block information is only returned when describing an active VPC peering connection. |
expiration_time | string | The time that an unaccepted VPC peering connection will expire. |
requester_vpc_info | string | Information about the requester VPC. CIDR block information is only returned when describing an active VPC peering connection. |
status | string | The status of the VPC peering connection. |
tags | string | Any tags assigned to the resource. |
vpc_peering_connection_id | string | The ID of the VPC peering connection. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_vpc_peering_connections | select | region | NextToken, MaxResults, DryRun, VpcPeeringConnectionId, Filter | Describes your VPC peering connections. The default is to describe all your VPC peering connections. Alternatively, you can specify specific VPC peering connection IDs or filter the results to include only the VPC peering connections that match specific criteria. |
create_vpc_peering_connection | insert | VpcId, region | PeerRegion, TagSpecification, DryRun, PeerVpcId, PeerOwnerId | Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. The accepter VPC can belong to another Amazon Web Services account and can be in a different Region to the requester VPC. The requester VPC and accepter VPC cannot have overlapping CIDR blocks. Limitations and rules apply to a VPC peering connection. For more information, see the VPC peering limitations in the VPC Peering Guide. The owner of the accepter VPC must accept the peering request to activate the peering connection. The VPC peering connection request expires after 7 days, after which it cannot be accepted or rejected. If you create a VPC peering connection request between VPCs with overlapping CIDR blocks, the VPC peering connection has a status of failed. |
modify_vpc_peering_connection_options | update | VpcPeeringConnectionId, region | AccepterPeeringConnectionOptions, DryRun, RequesterPeeringConnectionOptions | Modifies the VPC peering connection options on one side of a VPC peering connection. If the peered VPCs are in the same Amazon Web Services account, you can enable DNS resolution for queries from the local VPC. This ensures that queries from the local VPC resolve to private IP addresses in the peer VPC. This option is not available if the peered VPCs are in different Amazon Web Services accounts or different Regions. For peered VPCs in different Amazon Web Services accounts, each Amazon Web Services account owner must initiate a separate request to modify the peering connection options. For inter-region peering connections, you must use the Region for the requester VPC to modify the requester VPC peering options and the Region for the accepter VPC to modify the accepter VPC peering options. To verify which VPCs are the accepter and the requester for a VPC peering connection, use the DescribeVpcPeeringConnections command. |
delete_vpc_peering_connection | delete | VpcPeeringConnectionId, region | DryRun | Deletes a VPC peering connection. Either the owner of the requester VPC or the owner of the accepter VPC can delete the VPC peering connection if it's in the active state. The owner of the requester VPC can delete a VPC peering connection in the pending-acceptance state. You cannot delete a VPC peering connection that's in the failed or rejected state. |
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 |
|---|---|---|
VpcId | string | The ID of the requester VPC. You must specify this parameter in the request. |
VpcPeeringConnectionId | string | The ID of the VPC peering connection. |
region | string | AWS region (default: us-east-1) |
AccepterPeeringConnectionOptions | object | The VPC peering connection options for the accepter VPC. |
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 | The filters. accepter-vpc-info.cidr-block - The IPv4 CIDR block of the accepter VPC. accepter-vpc-info.owner-id - The ID of the Amazon Web Services account that owns the accepter VPC. accepter-vpc-info.vpc-id - The ID of the accepter VPC. expiration-time - The expiration date and time for the VPC peering connection. requester-vpc-info.cidr-block - The IPv4 CIDR block of the requester's VPC. requester-vpc-info.owner-id - The ID of the Amazon Web Services account that owns the requester VPC. requester-vpc-info.vpc-id - The ID of the requester VPC. status-code - The status of the VPC peering connection (pending-acceptance | failed | expired | provisioning | active | deleting | deleted | rejected). status-message - A message that provides more information about the status of the VPC peering connection, if applicable. tag - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value. tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value. vpc-peering-connection-id - The ID of the VPC peering connection. |
MaxResults | integer | The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination. |
NextToken | string | The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request. |
PeerOwnerId | string | The Amazon Web Services account ID of the owner of the accepter VPC. Default: Your Amazon Web Services account ID |
PeerRegion | string | The Region code for the accepter VPC, if the accepter VPC is located in a Region other than the Region in which you make the request. Default: The Region in which you make the request. |
PeerVpcId | string | The ID of the VPC with which you are creating the VPC peering connection. You must specify this parameter in the request. |
RequesterPeeringConnectionOptions | object | The VPC peering connection options for the requester VPC. |
TagSpecification | array | The tags to assign to the peering connection. |
VpcPeeringConnectionId | array | The IDs of the VPC peering connections. Default: Describes all your VPC peering connections. |
SELECT examples
- describe_vpc_peering_connections
Describes your VPC peering connections. The default is to describe all your VPC peering connections. Alternatively, you can specify specific VPC peering connection IDs or filter the results to include only the VPC peering connections that match specific criteria.
SELECT
accepter_vpc_info,
expiration_time,
requester_vpc_info,
status,
tags,
vpc_peering_connection_id
FROM aws.ec2.vpc_peering_connections
WHERE region = '{{ region }}' -- required
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
AND DryRun = '{{ DryRun }}'
AND VpcPeeringConnectionId = '{{ VpcPeeringConnectionId }}'
AND Filter = '{{ Filter }}'
;
INSERT examples
- create_vpc_peering_connection
- Manifest
Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. The accepter VPC can belong to another Amazon Web Services account and can be in a different Region to the requester VPC. The requester VPC and accepter VPC cannot have overlapping CIDR blocks. Limitations and rules apply to a VPC peering connection. For more information, see the VPC peering limitations in the VPC Peering Guide. The owner of the accepter VPC must accept the peering request to activate the peering connection. The VPC peering connection request expires after 7 days, after which it cannot be accepted or rejected. If you create a VPC peering connection request between VPCs with overlapping CIDR blocks, the VPC peering connection has a status of failed.
INSERT INTO aws.ec2.vpc_peering_connections (
VpcId,
region,
PeerRegion,
TagSpecification,
DryRun,
PeerVpcId,
PeerOwnerId
)
SELECT
'{{ VpcId }}',
'{{ region }}',
'{{ PeerRegion }}',
'{{ TagSpecification }}',
'{{ DryRun }}',
'{{ PeerVpcId }}',
'{{ PeerOwnerId }}'
RETURNING
accepter_vpc_info,
expiration_time,
requester_vpc_info,
status,
tags,
vpc_peering_connection_id
;
# Description fields are for documentation purposes
- name: vpc_peering_connections
props:
- name: VpcId
value: "{{ VpcId }}"
description: Required parameter for the vpc_peering_connections resource.
- name: region
value: "{{ region }}"
description: Required parameter for the vpc_peering_connections resource.
- name: PeerRegion
value: "{{ PeerRegion }}"
description: The Region code for the accepter VPC, if the accepter VPC is located in a Region other than the Region in which you make the request. Default: The Region in which you make the request.
description: The Region code for the accepter VPC, if the accepter VPC is located in a Region other than the Region in which you make the request. Default: The Region in which you make the request.
- name: TagSpecification
value: "{{ TagSpecification }}"
description: The tags to assign to the peering connection.
description: The tags to assign to the peering connection.
- 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.
- name: PeerVpcId
value: "{{ PeerVpcId }}"
description: The ID of the VPC with which you are creating the VPC peering connection. You must specify this parameter in the request.
description: The ID of the VPC with which you are creating the VPC peering connection. You must specify this parameter in the request.
- name: PeerOwnerId
value: "{{ PeerOwnerId }}"
description: The Amazon Web Services account ID of the owner of the accepter VPC. Default: Your Amazon Web Services account ID
description: The Amazon Web Services account ID of the owner of the accepter VPC. Default: Your Amazon Web Services account ID
UPDATE examples
- modify_vpc_peering_connection_options
Modifies the VPC peering connection options on one side of a VPC peering connection. If the peered VPCs are in the same Amazon Web Services account, you can enable DNS resolution for queries from the local VPC. This ensures that queries from the local VPC resolve to private IP addresses in the peer VPC. This option is not available if the peered VPCs are in different Amazon Web Services accounts or different Regions. For peered VPCs in different Amazon Web Services accounts, each Amazon Web Services account owner must initiate a separate request to modify the peering connection options. For inter-region peering connections, you must use the Region for the requester VPC to modify the requester VPC peering options and the Region for the accepter VPC to modify the accepter VPC peering options. To verify which VPCs are the accepter and the requester for a VPC peering connection, use the DescribeVpcPeeringConnections command.
UPDATE aws.ec2.vpc_peering_connections
SET
-- No updatable properties
WHERE
VpcPeeringConnectionId = '{{ VpcPeeringConnectionId }}' --required
AND region = '{{ region }}' --required
AND AccepterPeeringConnectionOptions = '{{ AccepterPeeringConnectionOptions}}'
AND DryRun = {{ DryRun}}
AND RequesterPeeringConnectionOptions = '{{ RequesterPeeringConnectionOptions}}'
RETURNING
accepter_peering_connection_options,
requester_peering_connection_options;
DELETE examples
- delete_vpc_peering_connection
Deletes a VPC peering connection. Either the owner of the requester VPC or the owner of the accepter VPC can delete the VPC peering connection if it's in the active state. The owner of the requester VPC can delete a VPC peering connection in the pending-acceptance state. You cannot delete a VPC peering connection that's in the failed or rejected state.
DELETE FROM aws.ec2.vpc_peering_connections
WHERE VpcPeeringConnectionId = '{{ VpcPeeringConnectionId }}' --required
AND region = '{{ region }}' --required
AND DryRun = '{{ DryRun }}'
;