Skip to main content

subnet_cidr_reservations

Creates, updates, deletes, gets or lists a subnet_cidr_reservations resource.

Overview

Namesubnet_cidr_reservations
TypeResource
Idaws.ec2.subnet_cidr_reservations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
next_tokenstringThe token to use to retrieve the next page of results. This value is null when there are no more results to return.
subnet_ipv_4_cidr_reservationsstringInformation about the IPv4 subnet CIDR reservations.
subnet_ipv_6_cidr_reservationsstringInformation about the IPv6 subnet CIDR reservations.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_subnet_cidr_reservationsselectSubnetId, regionFilter, DryRun, NextToken, MaxResultsGets information about the subnet CIDR reservations.
create_subnet_cidr_reservationinsertSubnetId, ReservationType, regionCidr, Description, DryRun, TagSpecificationCreates a subnet CIDR reservation. For more information, see Subnet CIDR reservations in the Amazon VPC User Guide and Manage prefixes for your network interfaces in the Amazon EC2 User Guide.
delete_subnet_cidr_reservationdeleteSubnetCidrReservationId, regionDryRunDeletes a subnet CIDR reservation.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
ReservationTypestringThe type of reservation. The reservation type determines how the reserved IP addresses are assigned to resources. prefix - Amazon Web Services assigns the reserved IP addresses to network interfaces. explicit - You assign the reserved IP addresses to network interfaces.
SubnetCidrReservationIdstringThe ID of the subnet CIDR reservation.
SubnetIdstringThe ID of the subnet.
regionstringAWS region (default: us-east-1)
CidrstringThe IPv4 or IPV6 CIDR range to reserve.
DescriptionstringThe description to assign to the subnet CIDR reservation.
DryRunbooleanChecks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
FilterarrayOne or more filters. reservationType - The type of reservation (prefix | explicit). subnet-id - The ID of the subnet. tag:<key> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value. tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.
MaxResultsintegerThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
NextTokenstringThe token for the next page of results.
TagSpecificationarrayThe tags to assign to the subnet CIDR reservation.

SELECT examples

Gets information about the subnet CIDR reservations.

SELECT
next_token,
subnet_ipv_4_cidr_reservations,
subnet_ipv_6_cidr_reservations
FROM aws.ec2.subnet_cidr_reservations
WHERE SubnetId = '{{ SubnetId }}' -- required
AND region = '{{ region }}' -- required
AND Filter = '{{ Filter }}'
AND DryRun = '{{ DryRun }}'
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
;

INSERT examples

Creates a subnet CIDR reservation. For more information, see Subnet CIDR reservations in the Amazon VPC User Guide and Manage prefixes for your network interfaces in the Amazon EC2 User Guide.

INSERT INTO aws.ec2.subnet_cidr_reservations (
SubnetId,
ReservationType,
region,
Cidr,
Description,
DryRun,
TagSpecification
)
SELECT
'{{ SubnetId }}',
'{{ ReservationType }}',
'{{ region }}',
'{{ Cidr }}',
'{{ Description }}',
'{{ DryRun }}',
'{{ TagSpecification }}'
RETURNING
cidr,
description,
owner_id,
reservation_type,
subnet_cidr_reservation_id,
subnet_id,
tags
;

DELETE examples

Deletes a subnet CIDR reservation.

DELETE FROM aws.ec2.subnet_cidr_reservations
WHERE SubnetCidrReservationId = '{{ SubnetCidrReservationId }}' --required
AND region = '{{ region }}' --required
AND DryRun = '{{ DryRun }}'
;