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.CreateKeyPair

Contents

Description

Creates a 2048-bit RSA key pair with the specified name. Amazon EC2 stores the public key and displays the private key for you to save to a file. The private key is returned as an unencrypted PEM encoded PKCS#8 private key. If a key with the specified name already exists, Amazon EC2 returns an error.

You can have up to five thousand key pairs per region.

The key pair returned to you is available only in the region in which you create it. To create a key pair that is available in all regions, use ImportKeyPair .

For more information about key pairs, see Key Pairs in the Amazon Elastic Compute Cloud User Guide .

Synopsis

Creating a Request

createKeyPair #

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

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

  • ckpDryRun - 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 .
  • ckpKeyName - A unique name for the key pair. Constraints: Up to 255 ASCII characters

data CreateKeyPair #

Contains the parameters for CreateKeyPair.

See: createKeyPair smart constructor.

Instances

Eq CreateKeyPair # 
Data CreateKeyPair # 

Methods

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

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

toConstr :: CreateKeyPair -> Constr #

dataTypeOf :: CreateKeyPair -> DataType #

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

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

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

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

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

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

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

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

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

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

Read CreateKeyPair # 
Show CreateKeyPair # 
Generic CreateKeyPair # 

Associated Types

type Rep CreateKeyPair :: * -> * #

Hashable CreateKeyPair # 
NFData CreateKeyPair # 

Methods

rnf :: CreateKeyPair -> () #

AWSRequest CreateKeyPair # 
ToQuery CreateKeyPair # 
ToPath CreateKeyPair # 
ToHeaders CreateKeyPair # 
type Rep CreateKeyPair # 
type Rep CreateKeyPair = D1 (MetaData "CreateKeyPair" "Network.AWS.EC2.CreateKeyPair" "amazonka-ec2-1.4.5-C4CR35JggG2GhWFrIiKGhu" False) (C1 (MetaCons "CreateKeyPair'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_ckpDryRun") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool))) (S1 (MetaSel (Just Symbol "_ckpKeyName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))))
type Rs CreateKeyPair # 

Request Lenses

ckpDryRun :: Lens' CreateKeyPair (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 .

ckpKeyName :: Lens' CreateKeyPair Text #

A unique name for the key pair. Constraints: Up to 255 ASCII characters

Destructuring the Response

createKeyPairResponse #

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

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

data CreateKeyPairResponse #

Describes a key pair.

See: createKeyPairResponse smart constructor.

Instances

Eq CreateKeyPairResponse # 
Data CreateKeyPairResponse # 

Methods

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

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

toConstr :: CreateKeyPairResponse -> Constr #

dataTypeOf :: CreateKeyPairResponse -> DataType #

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

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

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

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

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

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

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

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

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

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

Read CreateKeyPairResponse # 
Show CreateKeyPairResponse # 
Generic CreateKeyPairResponse # 
NFData CreateKeyPairResponse # 

Methods

rnf :: CreateKeyPairResponse -> () #

type Rep CreateKeyPairResponse # 
type Rep CreateKeyPairResponse = D1 (MetaData "CreateKeyPairResponse" "Network.AWS.EC2.CreateKeyPair" "amazonka-ec2-1.4.5-C4CR35JggG2GhWFrIiKGhu" False) (C1 (MetaCons "CreateKeyPairResponse'" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_ckprsResponseStatus") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int)) (S1 (MetaSel (Just Symbol "_ckprsKeyName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))) ((:*:) (S1 (MetaSel (Just Symbol "_ckprsKeyFingerprint") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)) (S1 (MetaSel (Just Symbol "_ckprsKeyMaterial") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))))

Response Lenses

ckprsResponseStatus :: Lens' CreateKeyPairResponse Int #

  • - | The response status code.

ckprsKeyName :: Lens' CreateKeyPairResponse Text #

The name of the key pair.

ckprsKeyFingerprint :: Lens' CreateKeyPairResponse Text #

The SHA-1 digest of the DER encoded private key.

ckprsKeyMaterial :: Lens' CreateKeyPairResponse Text #

An unencrypted PEM encoded RSA private key.