Skip to main content

vpc_cidr_blocks

Creates, updates, deletes or gets a vpc_cidr_block resource or lists vpc_cidr_blocks in a region

Overview

Namevpc_cidr_blocks
TypeResource
DescriptionResource Type definition for AWS::EC2::VPCCidrBlock
Idaws.ec2.vpc_cidr_blocks

Fields

NameDatatypeDescription
cidr_blockstringAn IPv4 CIDR block to associate with the VPC.
ipv6_poolstringThe ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.
idstringThe Id of the VPC associated CIDR Block.
vpc_idstringThe ID of the VPC.
ipv6_cidr_blockstringAn IPv6 CIDR block from the IPv6 address pool.
ipv4_ipam_pool_idstringThe ID of the IPv4 IPAM pool to Associate a CIDR from to a VPC.
ipv4_netmask_lengthintegerThe netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool.
ipv6_ipam_pool_idstringThe ID of the IPv6 IPAM pool to Associate a CIDR from to a VPC.
ipv6_netmask_lengthintegerThe netmask length of the IPv6 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool.
amazon_provided_ipv6_cidr_blockbooleanRequests 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.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTVpcId, region
delete_resourceDELETEdata__Identifier, region
list_resourcesSELECTregion
get_resourceSELECTdata__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.

/*+ create */
INSERT INTO aws.ec2.vpc_cidr_blocks (
VpcId,
region
)
SELECT
'{{ VpcId }}',
'{{ region }}';

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