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 | aws.ec2.vpc_peering_connections |
Fields
Name | Datatype | Description |
---|---|---|
id | string | |
peer_owner_id | string | The AWS account ID of the owner of the accepter VPC. |
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_role_arn | string | The Amazon Resource Name (ARN) of the VPC peer role for the peering connection in another AWS account. |
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. |
vpc_id | string | The ID of the VPC. |
tags | array | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | VpcId, PeerVpcId, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all vpc_peering_connections
in a region.
SELECT
region,
id,
peer_owner_id,
peer_region,
peer_role_arn,
peer_vpc_id,
vpc_id,
tags
FROM aws.ec2.vpc_peering_connections
WHERE region = 'us-east-1';
Gets all properties from an individual vpc_peering_connection
.
SELECT
region,
id,
peer_owner_id,
peer_region,
peer_role_arn,
peer_vpc_id,
vpc_id,
tags
FROM aws.ec2.vpc_peering_connections
WHERE region = 'us-east-1' AND data__Identifier = '<Id>';
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 aws.ec2.vpc_peering_connections (
PeerVpcId,
VpcId,
region
)
SELECT
'{{ PeerVpcId }}',
'{{ VpcId }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.vpc_peering_connections (
PeerOwnerId,
PeerRegion,
PeerRoleArn,
PeerVpcId,
VpcId,
Tags,
region
)
SELECT
'{{ PeerOwnerId }}',
'{{ PeerRegion }}',
'{{ PeerRoleArn }}',
'{{ PeerVpcId }}',
'{{ VpcId }}',
'{{ 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: PeerOwnerId
value: '{{ PeerOwnerId }}'
- name: PeerRegion
value: '{{ PeerRegion }}'
- name: PeerRoleArn
value: '{{ PeerRoleArn }}'
- name: PeerVpcId
value: '{{ PeerVpcId }}'
- name: VpcId
value: '{{ VpcId }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.ec2.vpc_peering_connections
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';
Permissions
To operate on the vpc_peering_connections
resource, the following permissions are required:
Create
ec2:CreateVpcPeeringConnection,
ec2:DescribeVpcPeeringConnections,
ec2:AcceptVpcPeeringConnection,
ec2:CreateTags,
sts:AssumeRole
Read
ec2:DescribeVpcPeeringConnections
Update
ec2:CreateTags,
ec2:DeleteTags,
ec2:DescribeVpcPeeringConnections
Delete
ec2:DeleteVpcPeeringConnection,
ec2:DescribeVpcPeeringConnections
List
ec2:DescribeVpcPeeringConnections