Skip to content

EC2  >  Structures  >  Subnet

Subnet

Structure Class

Subnet dataclass

Bases: _SerdeShape

Describes a subnet.

Attributes

assign_ipv6_address_on_creation class-attribute instance-attribute
assign_ipv6_address_on_creation: bool | None = ...

Indicates whether a network interface created in this subnet (including a network interface created by RunInstances) receives an IPv6 address.

availability_zone class-attribute instance-attribute
availability_zone: str | None = ...

The Availability Zone of the subnet.

availability_zone_id class-attribute instance-attribute
availability_zone_id: str | None = ...

The AZ ID of the subnet.

available_ip_address_count class-attribute instance-attribute
available_ip_address_count: int | None = ...

The number of unused private IPv4 addresses in the subnet. The IPv4 addresses for any stopped instances are considered unavailable.

block_public_access_states class-attribute instance-attribute
block_public_access_states: BlockPublicAccessStates | None = ...

The state of VPC Block Public Access (BPA).

cidr_block class-attribute instance-attribute
cidr_block: str | None = ...

The IPv4 CIDR block assigned to the subnet.

customer_owned_ipv4_pool class-attribute instance-attribute
customer_owned_ipv4_pool: str | None = ...

The customer-owned IPv4 address pool associated with the subnet.

default_for_az class-attribute instance-attribute
default_for_az: bool | None = ...

Indicates whether this is the default subnet for the Availability Zone.

enable_dns64 class-attribute instance-attribute
enable_dns64: bool | None = ...

Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.

enable_lni_at_device_index class-attribute instance-attribute
enable_lni_at_device_index: int | None = ...

Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1).

ipv6_cidr_block_association_set class-attribute instance-attribute
ipv6_cidr_block_association_set: list[SubnetIpv6CidrBlockAssociation] | None = ...

Information about the IPv6 CIDR blocks associated with the subnet.

ipv6_native class-attribute instance-attribute
ipv6_native: bool | None = ...

Indicates whether this is an IPv6 only subnet.

map_customer_owned_ip_on_launch class-attribute instance-attribute
map_customer_owned_ip_on_launch: bool | None = ...

Indicates whether a network interface created in this subnet (including a network interface created by RunInstances) receives a customer-owned IPv4 address.

map_public_ip_on_launch class-attribute instance-attribute
map_public_ip_on_launch: bool | None = ...

Indicates whether instances launched in this subnet receive 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.

outpost_arn class-attribute instance-attribute
outpost_arn: str | None = ...

The Amazon Resource Name (ARN) of the Outpost.

owner_id class-attribute instance-attribute
owner_id: str | None = ...

The ID of the Amazon Web Services account that owns the subnet.

private_dns_name_options_on_launch class-attribute instance-attribute
private_dns_name_options_on_launch: PrivateDnsNameOptionsOnLaunch | None = ...

The type of hostnames to assign to instances in the subnet at launch. An instance hostname is based on the IPv4 address or ID of the instance.

state class-attribute instance-attribute
state: str | None = ...

The current state of the subnet.

  • failed: The underlying infrastructure to support the subnet failed to provision as expected.

  • failed-insufficient-capacity: The underlying infrastructure to support the subnet failed to provision due to a shortage of EC2 instance capacity.

subnet_arn class-attribute instance-attribute
subnet_arn: str | None = ...

The Amazon Resource Name (ARN) of the subnet.

subnet_id class-attribute instance-attribute
subnet_id: str | None = ...

The ID of the subnet.

tags class-attribute instance-attribute
tags: list[Tag] | None = ...

Any tags assigned to the subnet.

type class-attribute instance-attribute
type: str | None = ...

Indicates if this is a subnet used with Amazon Elastic VMware Service (EVS). Possible values are Elastic VMware Service or no value. For more information about Amazon EVS, see Amazon Elastic VMware Service API Reference .

vpc_id class-attribute instance-attribute
vpc_id: str | None = ...

The ID of the VPC the subnet is in.