create_secondary_subnet
async
¶
create_secondary_subnet(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
client_token: Optional[String] = None,
availability_zone: Optional[AvailabilityZoneName] = None,
availability_zone_id: Optional[AvailabilityZoneId] = None,
dry_run: Optional[Boolean] = None,
ipv4_cidr_block: Optional[String] = None,
secondary_network_id: Optional[SecondaryNetworkId] = None,
tag_specifications: Optional[TagSpecificationList] = None,
) -> CreateSecondarySubnetResult
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.
Parameters:
-
client_token(Optional[String], default:None) –Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency.
-
availability_zone(Optional[AvailabilityZoneName], default:None) –The Availability Zone for the secondary subnet. You cannot specify both
AvailabilityZoneandAvailabilityZoneIdin the same request. -
availability_zone_id(Optional[AvailabilityZoneId], default:None) –The ID of the Availability Zone for the secondary subnet. This option is preferred over
AvailabilityZoneas it provides a consistent identifier across Amazon Web Services accounts. You cannot specify bothAvailabilityZoneandAvailabilityZoneIdin the same request. -
dry_run(Optional[Boolean], default:None) –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 isUnauthorizedOperation. -
ipv4_cidr_block(Optional[String], default:None) –The IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28.
-
secondary_network_id(Optional[SecondaryNetworkId], default:None) –The ID of the secondary network in which to create the secondary subnet.
-
tag_specifications(Optional[TagSpecificationList], default:None) –The tags to assign to the secondary subnet.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To create a secondary subnet This example creates a secondary subnet with a /24 CIDR block in the specified secondary network and Availability Zone.
>>> await client.create_secondary_subnet(secondary_network_id='sn-0123456789abcdef0', ipv4_cidr_block='10.0.0.0/24', availability_zone_id='use2-az1', client_token='550e8400-e29b-41d4-a716-446655440000', tag_specifications=[{'ResourceType': 'secondary-subnet', 'Tags': [{'Key': 'Name', 'Value': 'Prod Secondary Subnet'}, {'Key': 'Environment', 'Value': 'Production'}]}])
Source code in docs_src/capo_ec2/_services/async_ec2.py
12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 | |