modify_subnet_attribute
async
¶
modify_subnet_attribute(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
assign_ipv6_address_on_creation: Optional[AttributeBooleanValue] = None,
map_public_ip_on_launch: Optional[AttributeBooleanValue] = None,
subnet_id: Optional[SubnetId] = None,
map_customer_owned_ip_on_launch: Optional[AttributeBooleanValue] = None,
customer_owned_ipv4_pool: Optional[CoipPoolId] = None,
enable_dns64: Optional[AttributeBooleanValue] = None,
private_dns_hostname_type_on_launch: Optional[HostnameType] = None,
enable_resource_name_dns_a_record_on_launch: Optional[AttributeBooleanValue] = None,
enable_resource_name_dns_aaaa_record_on_launch: Optional[
AttributeBooleanValue
] = None,
enable_lni_at_device_index: Optional[Integer] = None,
disable_lni_at_device_index: Optional[AttributeBooleanValue] = None,
) -> None
Modifies a subnet attribute. You can only modify one attribute at a time.
Use this action to modify subnets on Amazon Web Services Outposts.
-
To modify a subnet on an Outpost rack, set both
MapCustomerOwnedIpOnLaunchandCustomerOwnedIpv4Pool. These two parameters act as a single attribute. -
To modify a subnet on an Outpost server, set either
EnableLniAtDeviceIndexorDisableLniAtDeviceIndex.
For more information about Amazon Web Services Outposts, see the following:
Parameters:
-
assign_ipv6_address_on_creation(Optional[AttributeBooleanValue], default:None) –Specify
trueto indicate that network interfaces created in the specified subnet should be assigned an IPv6 address. This includes a network interface that's created when launching an instance into the subnet (the instance therefore receives an IPv6 address).If you enable the IPv6 addressing feature for your subnet, your network interface or instance only receives an IPv6 address if it's created using version
2016-11-15or later of the Amazon EC2 API. -
map_public_ip_on_launch(Optional[AttributeBooleanValue], default:None) –Specify
trueto indicate that network interfaces attached to instances created in the specified subnet should be assigned a public IPv4 address.Amazon Web Services charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the Amazon VPC pricing page.
-
subnet_id(Optional[SubnetId], default:None) –The ID of the subnet.
-
map_customer_owned_ip_on_launch(Optional[AttributeBooleanValue], default:None) –Specify
trueto indicate that network interfaces attached to instances created in the specified subnet should be assigned a customer-owned IPv4 address.When this value is
true, you must specify the customer-owned IP pool usingCustomerOwnedIpv4Pool. -
customer_owned_ipv4_pool(Optional[CoipPoolId], default:None) –The customer-owned IPv4 address pool associated with the subnet.
You must set this value when you specify
trueforMapCustomerOwnedIpOnLaunch. -
enable_dns64(Optional[AttributeBooleanValue], default:None) –Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.
You must first configure a NAT gateway in a public subnet (separate from the subnet containing the IPv6-only workloads). For example, the subnet containing the NAT gateway should have a
0.0.0.0/0route pointing to the internet gateway. For more information, see Configure DNS64 and NAT64 in the Amazon VPC User Guide. -
private_dns_hostname_type_on_launch(Optional[HostnameType], default:None) –The type of hostname to assign to instances in the subnet at launch. For IPv4-only and dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be based on the instance IPv4 address (ip-name) or the instance ID (resource-name). For IPv6 only subnets, an instance DNS name must be based on the instance ID (resource-name).
-
enable_resource_name_dns_a_record_on_launch(Optional[AttributeBooleanValue], default:None) –Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
-
enable_resource_name_dns_aaaa_record_on_launch(Optional[AttributeBooleanValue], default:None) –Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
-
enable_lni_at_device_index(Optional[Integer], default:None) –Indicates the device position for local network interfaces in this subnet. For example,
1indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0). -
disable_lni_at_device_index(Optional[AttributeBooleanValue], default:None) –Specify
trueto indicate that local network interfaces at the current position should be disabled.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To change a subnet's public IP addressing behavior This example modifies the specified subnet so that all instances launched into this subnet are assigned a public IP address.
>>> await client.modify_subnet_attribute(subnet_id='subnet-1a2b3c4d', map_public_ip_on_launch={'Value': True})
Source code in docs_src/capo_ec2/_services/async_ec2.py
53310 53311 53312 53313 53314 53315 53316 53317 53318 53319 53320 53321 53322 53323 53324 53325 53326 53327 53328 53329 53330 53331 53332 53333 53334 53335 53336 53337 53338 53339 53340 53341 53342 53343 53344 53345 53346 53347 53348 53349 53350 53351 53352 53353 53354 53355 53356 53357 53358 53359 53360 53361 53362 53363 53364 53365 53366 53367 53368 53369 53370 53371 53372 53373 53374 53375 53376 53377 53378 53379 53380 53381 53382 53383 53384 53385 53386 53387 53388 53389 53390 53391 53392 53393 53394 53395 53396 53397 53398 53399 53400 53401 53402 53403 53404 53405 53406 53407 53408 53409 53410 53411 53412 53413 53414 53415 53416 53417 53418 53419 53420 53421 | |