Skip to main content

secondary_subnets

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

Overview

Namesecondary_subnets
TypeResource
Idaws.ec2.secondary_subnets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
availability_zonestringThe Availability Zone of the secondary subnet.
availability_zone_idstringThe ID of the Availability Zone of the secondary subnet.
ipv_4_cidr_block_associationsstringInformation about the IPv4 CIDR blocks associated with the secondary subnet.
owner_idstringThe ID of the Amazon Web Services account that owns the secondary subnet.
secondary_network_idstringThe ID of the secondary network.
secondary_network_typestringThe type of the secondary network.
secondary_subnet_arnstringThe Amazon Resource Name (ARN) of the secondary subnet.
secondary_subnet_idstringThe ID of the secondary subnet.
statestringThe state of the secondary subnet.
state_reasonstringThe reason for the current state of the secondary subnet.
tagsstringThe tags assigned to the secondary subnet.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_secondary_subnetsselectregionDryRun, Filter, MaxResults, NextToken, SecondarySubnetIdDescribes one or more of your secondary subnets.
create_secondary_subnetinsertIpv4CidrBlock, SecondaryNetworkId, regionClientToken, AvailabilityZone, AvailabilityZoneId, DryRun, TagSpecificationCreates a secondary subnet in a secondary network. A secondary subnet CIDR block must not overlap with the CIDR block of an existing secondary subnet in the secondary network. After you create a secondary subnet, you can't change its CIDR block. The allowed size for a secondary subnet CIDR block is between /28 netmask (16 IP addresses) and /12 netmask (1,048,576 IP addresses). Amazon reserves the first four IP addresses and the last IP address in each secondary subnet for internal use.
delete_secondary_subnetdeleteSecondarySubnetId, regionClientToken, DryRunDeletes a secondary subnet. A secondary subnet must not contain any secondary interfaces prior to deletion.

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
Ipv4CidrBlockstringThe IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28.
SecondaryNetworkIdstringThe ID of the secondary network in which to create the secondary subnet.
SecondarySubnetIdstringThe ID of the secondary subnet to delete.
regionstringAWS region (default: us-east-1)
AvailabilityZonestringThe Availability Zone for the secondary subnet. You cannot specify both AvailabilityZone and AvailabilityZoneId in the same request.
AvailabilityZoneIdstringThe ID of the Availability Zone for the secondary subnet. This option is preferred over AvailabilityZone as it provides a consistent identifier across Amazon Web Services accounts. You cannot specify both AvailabilityZone and AvailabilityZoneId in the same request.
ClientTokenstringUnique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency.
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.
FilterarrayThe filters. ipv4-cidr-block-association.association-id - The association ID for an IPv4 CIDR block associated with the secondary subnet. ipv4-cidr-block-association.cidr-block - An IPv4 CIDR block associated with the secondary subnet. ipv4-cidr-block-association.state - The state of an IPv4 CIDR block associated with the secondary subnet. owner-id - The ID of the Amazon Web Services account that owns the secondary subnet. secondary-network-id - The ID of the secondary network. secondary-network-type - The type of the secondary network (rdma). secondary-subnet-id - The ID of the secondary subnet. secondary-subnet-arn - The ARN of the secondary subnet. state - The state of the secondary subnet (create-in-progress | create-complete | create-failed | delete-in-progress | delete-complete | delete-failed). 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.
SecondarySubnetIdarrayThe IDs of the secondary subnets.
TagSpecificationarrayThe tags to assign to the secondary subnet.

SELECT examples

Describes one or more of your secondary subnets.

SELECT
availability_zone,
availability_zone_id,
ipv_4_cidr_block_associations,
owner_id,
secondary_network_id,
secondary_network_type,
secondary_subnet_arn,
secondary_subnet_id,
state,
state_reason,
tags
FROM aws.ec2.secondary_subnets
WHERE region = '{{ region }}' -- required
AND DryRun = '{{ DryRun }}'
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND SecondarySubnetId = '{{ SecondarySubnetId }}'
;

INSERT examples

Creates a secondary subnet in a secondary network. A secondary subnet CIDR block must not overlap with the CIDR block of an existing secondary subnet in the secondary network. After you create a secondary subnet, you can't change its CIDR block. The allowed size for a secondary subnet CIDR block is between /28 netmask (16 IP addresses) and /12 netmask (1,048,576 IP addresses). Amazon reserves the first four IP addresses and the last IP address in each secondary subnet for internal use.

INSERT INTO aws.ec2.secondary_subnets (
Ipv4CidrBlock,
SecondaryNetworkId,
region,
ClientToken,
AvailabilityZone,
AvailabilityZoneId,
DryRun,
TagSpecification
)
SELECT
'{{ Ipv4CidrBlock }}',
'{{ SecondaryNetworkId }}',
'{{ region }}',
'{{ ClientToken }}',
'{{ AvailabilityZone }}',
'{{ AvailabilityZoneId }}',
'{{ DryRun }}',
'{{ TagSpecification }}'
RETURNING
availability_zone,
availability_zone_id,
ipv_4_cidr_block_associations,
owner_id,
secondary_network_id,
secondary_network_type,
secondary_subnet_arn,
secondary_subnet_id,
state,
state_reason,
tags
;

DELETE examples

Deletes a secondary subnet. A secondary subnet must not contain any secondary interfaces prior to deletion.

DELETE FROM aws.ec2.secondary_subnets
WHERE SecondarySubnetId = '{{ SecondarySubnetId }}' --required
AND region = '{{ region }}' --required
AND ClientToken = '{{ ClientToken }}'
AND DryRun = '{{ DryRun }}'
;