Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- data CreateSubnet = CreateSubnet' {}
- newCreateSubnet :: Text -> CreateSubnet
- createSubnet_availabilityZone :: Lens' CreateSubnet (Maybe Text)
- createSubnet_availabilityZoneId :: Lens' CreateSubnet (Maybe Text)
- createSubnet_cidrBlock :: Lens' CreateSubnet (Maybe Text)
- createSubnet_dryRun :: Lens' CreateSubnet (Maybe Bool)
- createSubnet_ipv6CidrBlock :: Lens' CreateSubnet (Maybe Text)
- createSubnet_ipv6Native :: Lens' CreateSubnet (Maybe Bool)
- createSubnet_outpostArn :: Lens' CreateSubnet (Maybe Text)
- createSubnet_tagSpecifications :: Lens' CreateSubnet (Maybe [TagSpecification])
- createSubnet_vpcId :: Lens' CreateSubnet Text
- data CreateSubnetResponse = CreateSubnetResponse' {
- subnet :: Maybe Subnet
- httpStatus :: Int
- newCreateSubnetResponse :: Int -> CreateSubnetResponse
- createSubnetResponse_subnet :: Lens' CreateSubnetResponse (Maybe Subnet)
- createSubnetResponse_httpStatus :: Lens' CreateSubnetResponse Int
Creating a Request
data CreateSubnet Source #
See: newCreateSubnet
smart constructor.
CreateSubnet' | |
|
Instances
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.
createSubnet_tagSpecifications :: Lens' CreateSubnet (Maybe [TagSpecification]) Source #
The tags to assign to the subnet.
createSubnet_vpcId :: Lens' CreateSubnet Text Source #
The ID of the VPC.
Destructuring the Response
data CreateSubnetResponse Source #
See: newCreateSubnetResponse
smart constructor.
CreateSubnetResponse' | |
|
Instances
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
createSubnetResponse_subnet :: Lens' CreateSubnetResponse (Maybe Subnet) Source #
Information about the subnet.
createSubnetResponse_httpStatus :: Lens' CreateSubnetResponse Int Source #
The response's http status code.