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
Idawscc.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.
ipv6_address_attributestringThe value denoting whether an IPv6 VPC CIDR Block is public or private.
ip_sourcestringThe IP Source of an IPv6 VPC CIDR Block.
ipv6_cidr_block_network_border_groupstringThe name of the location from which we advertise the IPV6 CIDR block.
regionstringAWS region.

For more information, see AWS::EC2::VPCCidrBlock.

Methods

NameResourceAccessible byRequired Params
create_resourcevpc_cidr_blocksINSERTVpcId, region
delete_resourcevpc_cidr_blocksDELETEIdentifier, region
list_resourcesvpc_cidr_blocks_list_onlySELECTregion
get_resourcevpc_cidr_blocksSELECTIdentifier, region

SELECT examples

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,
ipv6_address_attribute,
ip_source,
ipv6_cidr_block_network_border_group
FROM awscc.ec2.vpc_cidr_blocks
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}|{{ vpc_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new vpc_cidr_block resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.ec2.vpc_cidr_blocks (
VpcId,
region
)
SELECT
'{{ vpc_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.ec2.vpc_cidr_blocks
WHERE
Identifier = '{{ id }}|{{ vpc_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:

ParameterDescription
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_cidr_blocks resource, the following permissions are required:

ec2:AssociateVpcCidrBlock,
ec2:DescribeVpcs,
ec2:AllocateIpamPoolCidr