secondary_subnets
Creates, updates, deletes, gets or lists a secondary_subnets resource.
Overview
| Name | secondary_subnets |
| Type | Resource |
| Id | aws.ec2.secondary_subnets |
Fields
The following fields are returned by SELECT queries:
- describe_secondary_subnets
| Name | Datatype | Description |
|---|---|---|
availability_zone | string | The Availability Zone of the secondary subnet. |
availability_zone_id | string | The ID of the Availability Zone of the secondary subnet. |
ipv_4_cidr_block_associations | string | Information about the IPv4 CIDR blocks associated with the secondary subnet. |
owner_id | string | The ID of the Amazon Web Services account that owns the secondary subnet. |
secondary_network_id | string | The ID of the secondary network. |
secondary_network_type | string | The type of the secondary network. |
secondary_subnet_arn | string | The Amazon Resource Name (ARN) of the secondary subnet. |
secondary_subnet_id | string | The ID of the secondary subnet. |
state | string | The state of the secondary subnet. |
state_reason | string | The reason for the current state of the secondary subnet. |
tags | string | The tags assigned to the secondary subnet. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_secondary_subnets | select | region | DryRun, Filter, MaxResults, NextToken, SecondarySubnetId | Describes one or more of your secondary subnets. |
create_secondary_subnet | insert | Ipv4CidrBlock, SecondaryNetworkId, region | ClientToken, AvailabilityZone, AvailabilityZoneId, DryRun, TagSpecification | 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. |
delete_secondary_subnet | delete | SecondarySubnetId, region | ClientToken, DryRun | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
Ipv4CidrBlock | string | The IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28. |
SecondaryNetworkId | string | The ID of the secondary network in which to create the secondary subnet. |
SecondarySubnetId | string | The ID of the secondary subnet to delete. |
region | string | AWS region (default: us-east-1) |
AvailabilityZone | string | The Availability Zone for the secondary subnet. You cannot specify both AvailabilityZone and AvailabilityZoneId in the same request. |
AvailabilityZoneId | string | The 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. |
ClientToken | string | Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency. |
DryRun | boolean | Checks 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. |
Filter | array | The 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. |
MaxResults | integer | The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value. |
NextToken | string | The token for the next page of results. |
SecondarySubnetId | array | The IDs of the secondary subnets. |
TagSpecification | array | The tags to assign to the secondary subnet. |
SELECT examples
- describe_secondary_subnets
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
- create_secondary_subnet
- Manifest
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
;
# Description fields are for documentation purposes
- name: secondary_subnets
props:
- name: Ipv4CidrBlock
value: "{{ Ipv4CidrBlock }}"
description: Required parameter for the secondary_subnets resource.
- name: SecondaryNetworkId
value: "{{ SecondaryNetworkId }}"
description: Required parameter for the secondary_subnets resource.
- name: region
value: "{{ region }}"
description: Required parameter for the secondary_subnets resource.
- name: ClientToken
value: "{{ ClientToken }}"
description: Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency.
description: Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency.
- name: AvailabilityZone
value: "{{ AvailabilityZone }}"
description: The Availability Zone for the secondary subnet. You cannot specify both AvailabilityZone and AvailabilityZoneId in the same request.
description: The Availability Zone for the secondary subnet. You cannot specify both AvailabilityZone and AvailabilityZoneId in the same request.
- name: AvailabilityZoneId
value: "{{ AvailabilityZoneId }}"
description: The 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.
description: The 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.
- name: DryRun
value: {{ DryRun }}
description: Checks 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.
description: Checks 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.
- name: TagSpecification
value: "{{ TagSpecification }}"
description: The tags to assign to the secondary subnet.
description: The tags to assign to the secondary subnet.
DELETE examples
- delete_secondary_subnet
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 }}'
;