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 | awscc.ec2.vpc_cidr_blocks |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
ipv6_address_attribute | string | The value denoting whether an IPv6 VPC CIDR Block is public or private. |
ip_source | string | The IP Source of an IPv6 VPC CIDR Block. |
ipv6_cidr_block_network_border_group | string | The name of the location from which we advertise the IPV6 CIDR block. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | The Id of the VPC associated CIDR Block. |
vpc_id | string | The ID of the VPC. |
region | string | AWS region. |
For more information, see AWS::EC2::VPCCidrBlock.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | vpc_cidr_blocks | INSERT | VpcId, region |
delete_resource | vpc_cidr_blocks | DELETE | Identifier, region |
list_resources | vpc_cidr_blocks_list_only | SELECT | region |
get_resource | vpc_cidr_blocks | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all vpc_cidr_blocks in a region.
SELECT
region,
id,
vpc_id
FROM awscc.ec2.vpc_cidr_blocks_list_only
WHERE
region = '{{ region }}';
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 awscc.ec2.vpc_cidr_blocks (
VpcId,
region
)
SELECT
'{{ vpc_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.ec2.vpc_cidr_blocks (
CidrBlock,
Ipv6Pool,
VpcId,
Ipv6CidrBlock,
Ipv4IpamPoolId,
Ipv4NetmaskLength,
Ipv6IpamPoolId,
Ipv6NetmaskLength,
AmazonProvidedIpv6CidrBlock,
Ipv6CidrBlockNetworkBorderGroup,
region
)
SELECT
'{{ cidr_block }}',
'{{ ipv6_pool }}',
'{{ 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_cidr_block_network_border_group }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: vpc_cidr_block
props:
- name: cidr_block
value: '{{ cidr_block }}'
- name: ipv6_pool
value: '{{ ipv6_pool }}'
- name: vpc_id
value: '{{ vpc_id }}'
- name: ipv6_cidr_block
value: '{{ ipv6_cidr_block }}'
- name: ipv4_ipam_pool_id
value: '{{ ipv4_ipam_pool_id }}'
- name: ipv4_netmask_length
value: '{{ ipv4_netmask_length }}'
- name: ipv6_ipam_pool_id
value: '{{ ipv6_ipam_pool_id }}'
- name: ipv6_netmask_length
value: '{{ ipv6_netmask_length }}'
- name: amazon_provided_ipv6_cidr_block
value: '{{ amazon_provided_ipv6_cidr_block }}'
- name: ipv6_cidr_block_network_border_group
value: '{{ ipv6_cidr_block_network_border_group }}'
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:
| Parameter | Description |
|---|---|
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:
- Create
- Read
- Delete
- List
ec2:AssociateVpcCidrBlock,
ec2:DescribeVpcs,
ec2:AllocateIpamPoolCidr
ec2:DescribeVpcs
ec2:DescribeVpcs,
ec2:DisassociateVpcCidrBlock
ec2:DescribeVpcs