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 = 'us-east-1' AND
Identifier = '{{ id }}';
Lists all vpc_peering_connections in a region.
SELECT
region,
id
FROM awscc.ec2.vpc_peering_connections_list_only
WHERE
region = 'us-east-1';
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 }}';
/*+ 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 }}';
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.ec2.vpc_peering_connections
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1';
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