amazonka-ec2-1.6.0: 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.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#1 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. If you prefer, you can create your own key pair using a third-party tool and upload it to any region using ImportKeyPair .

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

Synopsis

Creating a Request

createKeyPair Source #

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

Contains the parameters for CreateKeyPair.

See: createKeyPair smart constructor.

Instances

Eq CreateKeyPair Source # 
Data CreateKeyPair Source # 

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

Associated Types

type Rep CreateKeyPair :: * -> * #

Hashable CreateKeyPair Source # 
NFData CreateKeyPair Source # 

Methods

rnf :: CreateKeyPair -> () #

AWSRequest CreateKeyPair Source # 
ToHeaders CreateKeyPair Source # 
ToPath CreateKeyPair Source # 
ToQuery CreateKeyPair Source # 
type Rep CreateKeyPair Source # 
type Rep CreateKeyPair = D1 * (MetaData "CreateKeyPair" "Network.AWS.EC2.CreateKeyPair" "amazonka-ec2-1.6.0-Kkew7Kpgof6EYi20Z0WOzs" 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 Source # 

Request Lenses

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

ckpKeyName :: Lens' CreateKeyPair Text Source #

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

Destructuring the Response

createKeyPairResponse Source #

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

Describes a key pair.

See: createKeyPairResponse smart constructor.

Instances

Eq CreateKeyPairResponse Source # 
Data CreateKeyPairResponse Source # 

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

Methods

rnf :: CreateKeyPairResponse -> () #

type Rep CreateKeyPairResponse Source # 
type Rep CreateKeyPairResponse = D1 * (MetaData "CreateKeyPairResponse" "Network.AWS.EC2.CreateKeyPair" "amazonka-ec2-1.6.0-Kkew7Kpgof6EYi20Z0WOzs" False) (C1 * (MetaCons "CreateKeyPairResponse'" PrefixI True) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "_ckprsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (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 Source #

  • - | The response status code.

ckprsKeyName :: Lens' CreateKeyPairResponse Text Source #

The name of the key pair.

ckprsKeyFingerprint :: Lens' CreateKeyPairResponse Text Source #

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

ckprsKeyMaterial :: Lens' CreateKeyPairResponse Text Source #

An unencrypted PEM encoded RSA private key.