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

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 # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

Data CreateKeyPair # 
Instance details

Defined in Network.AWS.EC2.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 # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

Show CreateKeyPair # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

Generic CreateKeyPair # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

Associated Types

type Rep CreateKeyPair :: Type -> Type #

Hashable CreateKeyPair # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

AWSRequest CreateKeyPair # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

Associated Types

type Rs CreateKeyPair :: Type #

ToHeaders CreateKeyPair # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

ToPath CreateKeyPair # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

ToQuery CreateKeyPair # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

NFData CreateKeyPair # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

Methods

rnf :: CreateKeyPair -> () #

type Rep CreateKeyPair # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

type Rep CreateKeyPair = D1 (MetaData "CreateKeyPair" "Network.AWS.EC2.CreateKeyPair" "amazonka-ec2-1.6.1-H98Zd65xIYr2z4e5UhW9ck" False) (C1 (MetaCons "CreateKeyPair'" PrefixI True) (S1 (MetaSel (Just "_ckpDryRun") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 (MetaSel (Just "_ckpKeyName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))
type Rs CreateKeyPair # 
Instance details

Defined in Network.AWS.EC2.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 # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

Data CreateKeyPairResponse # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

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 # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

Show CreateKeyPairResponse # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

Generic CreateKeyPairResponse # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

Associated Types

type Rep CreateKeyPairResponse :: Type -> Type #

NFData CreateKeyPairResponse # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

Methods

rnf :: CreateKeyPairResponse -> () #

type Rep CreateKeyPairResponse # 
Instance details

Defined in Network.AWS.EC2.CreateKeyPair

type Rep CreateKeyPairResponse = D1 (MetaData "CreateKeyPairResponse" "Network.AWS.EC2.CreateKeyPair" "amazonka-ec2-1.6.1-H98Zd65xIYr2z4e5UhW9ck" False) (C1 (MetaCons "CreateKeyPairResponse'" PrefixI True) ((S1 (MetaSel (Just "_ckprsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "_ckprsKeyName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)) :*: (S1 (MetaSel (Just "_ckprsKeyFingerprint") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "_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.