amazonka-ec2-1.6.1: Amazon Elastic Compute Cloud SDK.

Copyright(c) 2013-2018 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.EC2.CreateSubnet

Contents

Description

Creates a subnet in an existing VPC.

When you create each subnet, you provide the VPC ID and the IPv4 CIDR block you want for the subnet. After you create a subnet, you can't change its CIDR block. The size of the subnet's IPv4 CIDR block can be the same as a VPC's IPv4 CIDR block, or a subset of a VPC's IPv4 CIDR block. If you create more than one subnet in a VPC, the subnets' CIDR blocks must not overlap. The smallest IPv4 subnet (and VPC) you can create uses a 28 netmask (16 IPv4 addresses), and the largest uses a 16 netmask (65,536 IPv4 addresses).

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.

Important: AWS 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.

If you launch an instance in a VPC using an Amazon EBS-backed AMI, the IP address doesn't change if you stop and restart the instance (unlike a similar instance launched outside a VPC, which gets a new IP address when restarted). 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

createSubnet Source #

Creates a value of CreateSubnet with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • cssIPv6CidrBlock - The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.
  • cssAvailabilityZone - The Availability Zone for the subnet. Default: AWS selects one for you. If you create more than one subnet in your VPC, we may not necessarily select a different zone for each subnet.
  • cssDryRun - 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 .
  • cssCidrBlock - The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24 .
  • cssVPCId - The ID of the VPC.

data CreateSubnet Source #

Contains the parameters for CreateSubnet.

See: createSubnet smart constructor.

Instances
Eq CreateSubnet Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

Data CreateSubnet Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CreateSubnet -> c CreateSubnet #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CreateSubnet #

toConstr :: CreateSubnet -> Constr #

dataTypeOf :: CreateSubnet -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CreateSubnet) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CreateSubnet) #

gmapT :: (forall b. Data b => b -> b) -> CreateSubnet -> CreateSubnet #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CreateSubnet -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CreateSubnet -> r #

gmapQ :: (forall d. Data d => d -> u) -> CreateSubnet -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CreateSubnet -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CreateSubnet -> m CreateSubnet #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CreateSubnet -> m CreateSubnet #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CreateSubnet -> m CreateSubnet #

Read CreateSubnet Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

Show CreateSubnet Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

Generic CreateSubnet Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

Associated Types

type Rep CreateSubnet :: Type -> Type #

Hashable CreateSubnet Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

AWSRequest CreateSubnet Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

Associated Types

type Rs CreateSubnet :: Type #

ToHeaders CreateSubnet Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

ToPath CreateSubnet Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

ToQuery CreateSubnet Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

NFData CreateSubnet Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

Methods

rnf :: CreateSubnet -> () #

type Rep CreateSubnet Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

type Rep CreateSubnet = D1 (MetaData "CreateSubnet" "Network.AWS.EC2.CreateSubnet" "amazonka-ec2-1.6.1-GgG1M0FWcBrE5I5IM2QktE" False) (C1 (MetaCons "CreateSubnet'" PrefixI True) ((S1 (MetaSel (Just "_cssIPv6CidrBlock") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_cssAvailabilityZone") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 (MetaSel (Just "_cssDryRun") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool)) :*: (S1 (MetaSel (Just "_cssCidrBlock") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "_cssVPCId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))))
type Rs CreateSubnet Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

Request Lenses

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

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

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

The Availability Zone for the subnet. Default: AWS selects one for you. If you create more than one subnet in your VPC, we may not necessarily select a different zone for each subnet.

cssDryRun :: 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 .

cssCidrBlock :: Lens' CreateSubnet Text Source #

The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24 .

cssVPCId :: Lens' CreateSubnet Text Source #

The ID of the VPC.

Destructuring the Response

createSubnetResponse Source #

Creates a value of CreateSubnetResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

data CreateSubnetResponse Source #

Contains the output of CreateSubnet.

See: createSubnetResponse smart constructor.

Instances
Eq CreateSubnetResponse Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

Data CreateSubnetResponse Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CreateSubnetResponse -> c CreateSubnetResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CreateSubnetResponse #

toConstr :: CreateSubnetResponse -> Constr #

dataTypeOf :: CreateSubnetResponse -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CreateSubnetResponse) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CreateSubnetResponse) #

gmapT :: (forall b. Data b => b -> b) -> CreateSubnetResponse -> CreateSubnetResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CreateSubnetResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CreateSubnetResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> CreateSubnetResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CreateSubnetResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CreateSubnetResponse -> m CreateSubnetResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CreateSubnetResponse -> m CreateSubnetResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CreateSubnetResponse -> m CreateSubnetResponse #

Read CreateSubnetResponse Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

Show CreateSubnetResponse Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

Generic CreateSubnetResponse Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

Associated Types

type Rep CreateSubnetResponse :: Type -> Type #

NFData CreateSubnetResponse Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

Methods

rnf :: CreateSubnetResponse -> () #

type Rep CreateSubnetResponse Source # 
Instance details

Defined in Network.AWS.EC2.CreateSubnet

type Rep CreateSubnetResponse = D1 (MetaData "CreateSubnetResponse" "Network.AWS.EC2.CreateSubnet" "amazonka-ec2-1.6.1-GgG1M0FWcBrE5I5IM2QktE" False) (C1 (MetaCons "CreateSubnetResponse'" PrefixI True) (S1 (MetaSel (Just "_crersSubnet") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Subnet)) :*: S1 (MetaSel (Just "_crersResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)))

Response Lenses

crersSubnet :: Lens' CreateSubnetResponse (Maybe Subnet) Source #

Information about the subnet.

crersResponseStatus :: Lens' CreateSubnetResponse Int Source #

  • - | The response status code.