vpc_cidr_blocks
Creates, updates, deletes or gets a vpc_cidr_block
resource or lists vpc_cidr_blocks
in a region
Overview
Name | vpc_cidr_blocks |
Type | Resource |
Description | Resource Type definition for AWS::EC2::VPCCidrBlock |
Id | aws.ec2.vpc_cidr_blocks |
Fields
Name | Datatype | Description |
---|---|---|
cidr_block | string | An IPv4 CIDR block to associate with the VPC. |
ipv6_pool | string | The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block. |
id | string | The Id of the VPC associated CIDR Block. |
vpc_id | string | The ID of the VPC. |
ipv6_cidr_block | string | An IPv6 CIDR block from the IPv6 address pool. |
ipv4_ipam_pool_id | string | The ID of the IPv4 IPAM pool to Associate a CIDR from to a VPC. |
ipv4_netmask_length | integer | The netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. |
ipv6_ipam_pool_id | string | The ID of the IPv6 IPAM pool to Associate a CIDR from to a VPC. |
ipv6_netmask_length | integer | The netmask length of the IPv6 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. |
amazon_provided_ipv6_cidr_block | boolean | Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IPv6 addresses, or the size of the CIDR block. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | VpcId, region |
delete_resource | DELETE | data__Identifier, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all vpc_cidr_blocks
in a region.
SELECT
region,
cidr_block,
ipv6_pool,
id,
vpc_id,
ipv6_cidr_block,
ipv4_ipam_pool_id,
ipv4_netmask_length,
ipv6_ipam_pool_id,
ipv6_netmask_length,
amazon_provided_ipv6_cidr_block
FROM aws.ec2.vpc_cidr_blocks
WHERE region = 'us-east-1';
Gets all properties from an individual vpc_cidr_block
.
SELECT
region,
cidr_block,
ipv6_pool,
id,
vpc_id,
ipv6_cidr_block,
ipv4_ipam_pool_id,
ipv4_netmask_length,
ipv6_ipam_pool_id,
ipv6_netmask_length,
amazon_provided_ipv6_cidr_block
FROM aws.ec2.vpc_cidr_blocks
WHERE region = 'us-east-1' AND data__Identifier = '<Id>|<VpcId>';
INSERT
example
Use the following StackQL query and manifest file to create a new vpc_cidr_block
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ec2.vpc_cidr_blocks (
VpcId,
region
)
SELECT
'{{ VpcId }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.vpc_cidr_blocks (
CidrBlock,
Ipv6Pool,
VpcId,
Ipv6CidrBlock,
Ipv4IpamPoolId,
Ipv4NetmaskLength,
Ipv6IpamPoolId,
Ipv6NetmaskLength,
AmazonProvidedIpv6CidrBlock,
region
)
SELECT
'{{ CidrBlock }}',
'{{ Ipv6Pool }}',
'{{ VpcId }}',
'{{ Ipv6CidrBlock }}',
'{{ Ipv4IpamPoolId }}',
'{{ Ipv4NetmaskLength }}',
'{{ Ipv6IpamPoolId }}',
'{{ Ipv6NetmaskLength }}',
'{{ AmazonProvidedIpv6CidrBlock }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: vpc_cidr_block
props:
- name: CidrBlock
value: '{{ CidrBlock }}'
- name: Ipv6Pool
value: '{{ Ipv6Pool }}'
- name: VpcId
value: '{{ VpcId }}'
- name: Ipv6CidrBlock
value: '{{ Ipv6CidrBlock }}'
- name: Ipv4IpamPoolId
value: '{{ Ipv4IpamPoolId }}'
- name: Ipv4NetmaskLength
value: '{{ Ipv4NetmaskLength }}'
- name: Ipv6IpamPoolId
value: '{{ Ipv6IpamPoolId }}'
- name: Ipv6NetmaskLength
value: '{{ Ipv6NetmaskLength }}'
- name: AmazonProvidedIpv6CidrBlock
value: '{{ AmazonProvidedIpv6CidrBlock }}'
DELETE
example
/*+ delete */
DELETE FROM aws.ec2.vpc_cidr_blocks
WHERE data__Identifier = '<Id|VpcId>'
AND region = 'us-east-1';
Permissions
To operate on the vpc_cidr_blocks
resource, the following permissions are required:
Create
ec2:AssociateVpcCidrBlock,
ec2:DescribeVpcs,
ec2:AllocateIpamPoolCidr
Read
ec2:DescribeVpcs
Delete
ec2:DescribeVpcs,
ec2:DisassociateVpcCidrBlock
List
ec2:DescribeVpcs