Skip to main content

vpc_peering_connections

Creates, updates, deletes or gets a vpc_peering_connection resource or lists vpc_peering_connections in a region

Overview

Namevpc_peering_connections
TypeResource
DescriptionResource Type definition for AWS::EC2::VPCPeeringConnection
Idawscc.ec2.vpc_peering_connections

Fields

NameDatatypeDescription
peer_role_arnstringThe Amazon Resource Name (ARN) of the VPC peer role for the peering connection in another AWS account.
vpc_idstringThe ID of the VPC.
peer_vpc_idstringThe ID of the VPC with which you are creating the VPC peering connection. You must specify this parameter in the request.
idstring
peer_regionstringThe 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.
peer_owner_idstringThe AWS account ID of the owner of the accepter VPC.
tagsarray
regionstringAWS region.

For more information, see AWS::EC2::VPCPeeringConnection.

Methods

NameResourceAccessible byRequired Params
create_resourcevpc_peering_connectionsINSERTVpcId, PeerVpcId, region
delete_resourcevpc_peering_connectionsDELETEIdentifier, region
update_resourcevpc_peering_connectionsUPDATEIdentifier, PatchDocument, region
list_resourcesvpc_peering_connections_list_onlySELECTregion
get_resourcevpc_peering_connectionsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual vpc_peering_connection.

SELECT
region,
peer_role_arn,
vpc_id,
peer_vpc_id,
id,
peer_region,
peer_owner_id,
tags
FROM awscc.ec2.vpc_peering_connections
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';

INSERT example

Use the following StackQL query and manifest file to create a new vpc_peering_connection resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.ec2.vpc_peering_connections (
VpcId,
PeerVpcId,
region
)
SELECT
'{{ vpc_id }}',
'{{ peer_vpc_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a vpc_peering_connection resource, using stack-deploy.

/*+ update */
UPDATE awscc.ec2.vpc_peering_connections
SET PatchDocument = string('{{ {
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.ec2.vpc_peering_connections
WHERE
Identifier = '{{ id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the vpc_peering_connections resource, the following permissions are required:

ec2:DescribeVpcPeeringConnections