subnet_cidr_blocks
Creates, updates, deletes or gets a subnet_cidr_block resource or lists subnet_cidr_blocks in a region
Overview
| Name | subnet_cidr_blocks |
| Type | Resource |
| Description | The AWS::EC2::SubnetCidrBlock resource creates association between subnet and IPv6 CIDR |
| Id | awscc.ec2.subnet_cidr_blocks |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
id | string | Information about the IPv6 association. |
ipv6_cidr_block | string | The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length |
ipv6_ipam_pool_id | string | The ID of an IPv6 Amazon VPC IP Address Manager (IPAM) pool from which to allocate, to get the subnet's CIDR |
ipv6_netmask_length | integer | The netmask length of the IPv6 CIDR to allocate to the subnet from an IPAM pool |
subnet_id | string | The ID of the subnet |
ipv6_address_attribute | string | The value denoting whether an IPv6 Subnet CIDR Block is public or private. |
ip_source | string | The IP Source of an IPv6 Subnet CIDR Block. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | Information about the IPv6 association. |
region | string | AWS region. |
For more information, see AWS::EC2::SubnetCidrBlock.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | subnet_cidr_blocks | INSERT | SubnetId, region |
delete_resource | subnet_cidr_blocks | DELETE | Identifier, region |
list_resources | subnet_cidr_blocks_list_only | SELECT | region |
get_resource | subnet_cidr_blocks | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual subnet_cidr_block.
SELECT
region,
id,
ipv6_cidr_block,
ipv6_ipam_pool_id,
ipv6_netmask_length,
subnet_id,
ipv6_address_attribute,
ip_source
FROM awscc.ec2.subnet_cidr_blocks
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';
Lists all subnet_cidr_blocks in a region.
SELECT
region,
id
FROM awscc.ec2.subnet_cidr_blocks_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new subnet_cidr_block resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ec2.subnet_cidr_blocks (
SubnetId,
region
)
SELECT
'{{ subnet_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.ec2.subnet_cidr_blocks (
Ipv6CidrBlock,
Ipv6IpamPoolId,
Ipv6NetmaskLength,
SubnetId,
region
)
SELECT
'{{ ipv6_cidr_block }}',
'{{ ipv6_ipam_pool_id }}',
'{{ ipv6_netmask_length }}',
'{{ subnet_id }}',
'{{ 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: subnet_cidr_block
props:
- name: ipv6_cidr_block
value: '{{ ipv6_cidr_block }}'
- name: ipv6_ipam_pool_id
value: '{{ ipv6_ipam_pool_id }}'
- name: ipv6_netmask_length
value: '{{ ipv6_netmask_length }}'
- name: subnet_id
value: '{{ subnet_id }}'
DELETE example
/*+ delete */
DELETE FROM awscc.ec2.subnet_cidr_blocks
WHERE
Identifier = '{{ 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 subnet_cidr_blocks resource, the following permissions are required:
- Create
- Delete
- List
- Read
ec2:AssociateSubnetCidrBlock,
ec2:DescribeSubnets
ec2:DisassociateSubnetCidrBlock,
ec2:DescribeSubnets
ec2:DescribeSubnets
ec2:DescribeSubnets