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

Copyright(c) 2013-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@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 CIDR block you want for the subnet. After you create a subnet, you can't change its CIDR block. The subnet's IPv4 CIDR block can be the same as the VPC's IPv4 CIDR block (assuming you want only a single subnet in the VPC), or a subset of the 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 IP 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 .
  • cssVPCId - The ID of the VPC.
  • cssCidrBlock - The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24 .

data CreateSubnet Source #

Contains the parameters for CreateSubnet.

See: createSubnet smart constructor.

Instances

Eq CreateSubnet Source # 
Data CreateSubnet Source # 

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 # 
Show CreateSubnet Source # 
Generic CreateSubnet Source # 

Associated Types

type Rep CreateSubnet :: * -> * #

Hashable CreateSubnet Source # 
NFData CreateSubnet Source # 

Methods

rnf :: CreateSubnet -> () #

AWSRequest CreateSubnet Source # 
ToPath CreateSubnet Source # 
ToHeaders CreateSubnet Source # 
ToQuery CreateSubnet Source # 
type Rep CreateSubnet Source # 
type Rep CreateSubnet = D1 (MetaData "CreateSubnet" "Network.AWS.EC2.CreateSubnet" "amazonka-ec2-1.4.5-4J1X1aohvSR7xjHvMmTrf6" False) (C1 (MetaCons "CreateSubnet'" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_cssIPv6CidrBlock") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_cssAvailabilityZone") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)))) ((:*:) (S1 (MetaSel (Just Symbol "_cssDryRun") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool))) ((:*:) (S1 (MetaSel (Just Symbol "_cssVPCId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)) (S1 (MetaSel (Just Symbol "_cssCidrBlock") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))))))
type Rs CreateSubnet Source # 

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 .

cssVPCId :: Lens' CreateSubnet Text Source #

The ID of the VPC.

cssCidrBlock :: Lens' CreateSubnet Text Source #

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

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 # 
Data CreateSubnetResponse Source # 

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 # 
Show CreateSubnetResponse Source # 
Generic CreateSubnetResponse Source # 
NFData CreateSubnetResponse Source # 

Methods

rnf :: CreateSubnetResponse -> () #

type Rep CreateSubnetResponse Source # 
type Rep CreateSubnetResponse = D1 (MetaData "CreateSubnetResponse" "Network.AWS.EC2.CreateSubnet" "amazonka-ec2-1.4.5-4J1X1aohvSR7xjHvMmTrf6" False) (C1 (MetaCons "CreateSubnetResponse'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_crsSubnet") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Subnet))) (S1 (MetaSel (Just Symbol "_crsResponseStatus") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int))))

Response Lenses

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

Information about the subnet.

crsResponseStatus :: Lens' CreateSubnetResponse Int Source #

  • - | The response status code.