vpc_peering_connections
Creates, updates, deletes or gets a vpc_peering_connection resource or lists vpc_peering_connections in a region
Overview
| Name | vpc_peering_connections |
| Type | Resource |
| Description | Resource Type definition for AWS::EC2::VPCPeeringConnection |
| Id | awscc.ec2.vpc_peering_connections |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
peer_role_arn | string | The Amazon Resource Name (ARN) of the VPC peer role for the peering connection in another AWS account. |
vpc_id | string | The ID of the VPC. |
peer_vpc_id | string | The ID of the VPC with which you are creating the VPC peering connection. You must specify this parameter in the request. |
id | string | |
peer_region | 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. |
peer_owner_id | string | The AWS account ID of the owner of the accepter VPC. |
tags | array | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | |
region | string | AWS region. |
For more information, see AWS::EC2::VPCPeeringConnection.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | vpc_peering_connections | INSERT | VpcId, PeerVpcId, region |
delete_resource | vpc_peering_connections | DELETE | Identifier, region |
update_resource | vpc_peering_connections | UPDATE | Identifier, PatchDocument, region |
list_resources | vpc_peering_connections_list_only | SELECT | region |
get_resource | vpc_peering_connections | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all vpc_peering_connections in a region.
SELECT
region,
id
FROM awscc.ec2.vpc_peering_connections_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new vpc_peering_connection resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ 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
;
/*+ create */
INSERT INTO awscc.ec2.vpc_peering_connections (
PeerRoleArn,
VpcId,
PeerVpcId,
PeerRegion,
PeerOwnerId,
Tags,
region
)
SELECT
'{{ peer_role_arn }}',
'{{ vpc_id }}',
'{{ peer_vpc_id }}',
'{{ peer_region }}',
'{{ peer_owner_id }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: vpc_peering_connection
props:
- name: peer_role_arn
value: '{{ peer_role_arn }}'
- name: vpc_id
value: '{{ vpc_id }}'
- name: peer_vpc_id
value: '{{ peer_vpc_id }}'
- name: peer_region
value: '{{ peer_region }}'
- name: peer_owner_id
value: '{{ peer_owner_id }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
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:
| Parameter | Description |
|---|---|
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:
- Read
- Create
- Update
- List
- Delete
ec2:DescribeVpcPeeringConnections
ec2:CreateVpcPeeringConnection,
ec2:DescribeVpcPeeringConnections,
ec2:AcceptVpcPeeringConnection,
ec2:CreateTags,
sts:AssumeRole
ec2:CreateTags,
ec2:DeleteTags,
ec2:DescribeVpcPeeringConnections
ec2:DescribeVpcPeeringConnections
ec2:DeleteVpcPeeringConnection,
ec2:DescribeVpcPeeringConnections