Skip to content

EC2  >  Operations  >  create_default_subnet

create_default_subnet

Operation

create_default_subnet async

create_default_subnet(request: CreateDefaultSubnetInput | CreateDefaultSubnetInputDict, /, *, plugins: list[Plugin] | None = None) -> CreateDefaultSubnetOutput
create_default_subnet(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateDefaultSubnetInputDict]) -> 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
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

Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.

Model

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.

Dictionaries

CreateDefaultSubnetInputDict

Bases: TypedDict

Dictionary form of CreateDefaultSubnetInput.

Attributes
availability_zone 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 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 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 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.