Skip to content

EC2  >  Operations  >  create_default_subnet

create_default_subnet

Operation

create_default_subnet async

create_default_subnet(input: CreateDefaultSubnetInput, plugins: list[Plugin] | None = None) -> CreateDefaultSubnetOutput

Creates a default subnet with a size /20 IPv4 CIDR block in the specified Availability Zone in your default VPC. You can have only one default subnet per Availability Zone. For more information, see Create a default subnet in the Amazon VPC User Guide.

Parameters:

Name Type Description Default
input CreateDefaultSubnetInput

An instance of CreateDefaultSubnetInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CreateDefaultSubnetOutput

An instance of CreateDefaultSubnetOutput.

Input

CreateDefaultSubnetInput dataclass

Bases: _SerdeShape

Dataclass for CreateDefaultSubnetInput structure.

Attributes

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

The Availability Zone in which to create the default subnet.

Either AvailabilityZone or AvailabilityZoneId must be specified, but not both.

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

The ID of the Availability Zone.

Either AvailabilityZone or AvailabilityZoneId must be specified, but not both.

dry_run class-attribute instance-attribute
dry_run: bool | 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 is UnauthorizedOperation.

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

Indicates whether to create an IPv6 only subnet. If you already have a default subnet for this Availability Zone, you must delete it before you can create an IPv6 only subnet.

Output

CreateDefaultSubnetOutput dataclass

Bases: _SerdeShape

Dataclass for CreateDefaultSubnetOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

subnet class-attribute instance-attribute
subnet: Subnet | None = ...

Information about the subnet.