amazonka-ec2-2.0: Amazon Elastic Compute Cloud SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.EC2.CreateSubnet

Description

Creates a subnet in a specified VPC.

You must specify an IPv4 CIDR block for the subnet. After you create a subnet, you can't change its CIDR block. The allowed block size is between a /16 netmask (65,536 IP addresses) and /28 netmask (16 IP addresses). The CIDR block must not overlap with the CIDR block of an existing subnet in the VPC.

If you've associated an IPv6 CIDR block with your VPC, you can create a subnet with an IPv6 CIDR block that uses a /64 prefix length.

Amazon Web Services reserves both the first four and the last IPv4 address in each subnet's CIDR block. They're not available for use.

If you add more than one subnet to a VPC, they're set up in a star topology with a logical router in the middle.

When you stop an instance in a subnet, it retains its private IPv4 address. It's therefore possible to have a subnet with no running instances (they're all stopped), but no remaining IP addresses available.

For more information about subnets, see Your VPC and subnets in the Amazon Virtual Private Cloud User Guide.

Synopsis

Creating a Request

data CreateSubnet Source #

See: newCreateSubnet smart constructor.

Constructors

CreateSubnet' 

Fields

  • availabilityZone :: Maybe Text

    The Availability Zone or Local Zone for the subnet.

    Default: Amazon Web Services selects one for you. If you create more than one subnet in your VPC, we do not necessarily select a different zone for each subnet.

    To create a subnet in a Local Zone, set this value to the Local Zone ID, for example us-west-2-lax-1a. For information about the Regions that support Local Zones, see Available Regions in the Amazon Elastic Compute Cloud User Guide.

    To create a subnet in an Outpost, set this value to the Availability Zone for the Outpost and specify the Outpost ARN.

  • availabilityZoneId :: Maybe Text

    The AZ ID or the Local Zone ID of the subnet.

  • cidrBlock :: Maybe Text

    The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.

    This parameter is not supported for an IPv6 only subnet.

  • dryRun :: Maybe Bool

    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.

  • ipv6CidrBlock :: Maybe Text

    The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.

    This parameter is required for an IPv6 only subnet.

  • ipv6Native :: Maybe Bool

    Indicates whether to create an IPv6 only subnet.

  • outpostArn :: Maybe Text

    The Amazon Resource Name (ARN) of the Outpost. If you specify an Outpost ARN, you must also specify the Availability Zone of the Outpost subnet.

  • tagSpecifications :: Maybe [TagSpecification]

    The tags to assign to the subnet.

  • vpcId :: Text

    The ID of the VPC.

Instances

Instances details
ToHeaders CreateSubnet Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

ToPath CreateSubnet Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

ToQuery CreateSubnet Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

AWSRequest CreateSubnet Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

Associated Types

type AWSResponse CreateSubnet #

Generic CreateSubnet Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

Associated Types

type Rep CreateSubnet :: Type -> Type #

Read CreateSubnet Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

Show CreateSubnet Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

NFData CreateSubnet Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

Methods

rnf :: CreateSubnet -> () #

Eq CreateSubnet Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

Hashable CreateSubnet Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

type AWSResponse CreateSubnet Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

type Rep CreateSubnet Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

newCreateSubnet Source #

Create a value of CreateSubnet with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

CreateSubnet, createSubnet_availabilityZone - The Availability Zone or Local Zone for the subnet.

Default: Amazon Web Services selects one for you. If you create more than one subnet in your VPC, we do not necessarily select a different zone for each subnet.

To create a subnet in a Local Zone, set this value to the Local Zone ID, for example us-west-2-lax-1a. For information about the Regions that support Local Zones, see Available Regions in the Amazon Elastic Compute Cloud User Guide.

To create a subnet in an Outpost, set this value to the Availability Zone for the Outpost and specify the Outpost ARN.

CreateSubnet, createSubnet_availabilityZoneId - The AZ ID or the Local Zone ID of the subnet.

CreateSubnet, createSubnet_cidrBlock - The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.

This parameter is not supported for an IPv6 only subnet.

$sel:dryRun:CreateSubnet', createSubnet_dryRun - 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.

CreateSubnet, createSubnet_ipv6CidrBlock - The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.

This parameter is required for an IPv6 only subnet.

CreateSubnet, createSubnet_ipv6Native - Indicates whether to create an IPv6 only subnet.

CreateSubnet, createSubnet_outpostArn - The Amazon Resource Name (ARN) of the Outpost. If you specify an Outpost ARN, you must also specify the Availability Zone of the Outpost subnet.

CreateSubnet, createSubnet_tagSpecifications - The tags to assign to the subnet.

CreateSubnet, createSubnet_vpcId - The ID of the VPC.

Request Lenses

createSubnet_availabilityZone :: Lens' CreateSubnet (Maybe Text) Source #

The Availability Zone or Local Zone for the subnet.

Default: Amazon Web Services selects one for you. If you create more than one subnet in your VPC, we do not necessarily select a different zone for each subnet.

To create a subnet in a Local Zone, set this value to the Local Zone ID, for example us-west-2-lax-1a. For information about the Regions that support Local Zones, see Available Regions in the Amazon Elastic Compute Cloud User Guide.

To create a subnet in an Outpost, set this value to the Availability Zone for the Outpost and specify the Outpost ARN.

createSubnet_availabilityZoneId :: Lens' CreateSubnet (Maybe Text) Source #

The AZ ID or the Local Zone ID of the subnet.

createSubnet_cidrBlock :: Lens' CreateSubnet (Maybe Text) Source #

The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.

This parameter is not supported for an IPv6 only subnet.

createSubnet_dryRun :: Lens' CreateSubnet (Maybe Bool) Source #

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.

createSubnet_ipv6CidrBlock :: Lens' CreateSubnet (Maybe Text) Source #

The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.

This parameter is required for an IPv6 only subnet.

createSubnet_ipv6Native :: Lens' CreateSubnet (Maybe Bool) Source #

Indicates whether to create an IPv6 only subnet.

createSubnet_outpostArn :: Lens' CreateSubnet (Maybe Text) Source #

The Amazon Resource Name (ARN) of the Outpost. If you specify an Outpost ARN, you must also specify the Availability Zone of the Outpost subnet.

Destructuring the Response

data CreateSubnetResponse Source #

See: newCreateSubnetResponse smart constructor.

Constructors

CreateSubnetResponse' 

Fields

Instances

Instances details
Generic CreateSubnetResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

Associated Types

type Rep CreateSubnetResponse :: Type -> Type #

Read CreateSubnetResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

Show CreateSubnetResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

NFData CreateSubnetResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

Methods

rnf :: CreateSubnetResponse -> () #

Eq CreateSubnetResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

type Rep CreateSubnetResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateSubnet

type Rep CreateSubnetResponse = D1 ('MetaData "CreateSubnetResponse" "Amazonka.EC2.CreateSubnet" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "CreateSubnetResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "subnet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Subnet)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newCreateSubnetResponse Source #

Create a value of CreateSubnetResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

CreateSubnetResponse, createSubnetResponse_subnet - Information about the subnet.

$sel:httpStatus:CreateSubnetResponse', createSubnetResponse_httpStatus - The response's http status code.

Response Lenses