amazonka-ec2-2.0: Amazon Elastic Compute Cloud SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.EC2.ImportKeyPair

Description

Imports the public key from an RSA or ED25519 key pair that you created with a third-party tool. Compare this with CreateKeyPair, in which Amazon Web Services creates the key pair and gives the keys to you (Amazon Web Services keeps a copy of the public key). With ImportKeyPair, you create the key pair and give Amazon Web Services just the public key. The private key is never transferred between you and Amazon Web Services.

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

Synopsis

Creating a Request

data ImportKeyPair Source #

See: newImportKeyPair smart constructor.

Constructors

ImportKeyPair' 

Fields

  • dryRun :: 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.

  • tagSpecifications :: Maybe [TagSpecification]

    The tags to apply to the imported key pair.

  • keyName :: Text

    A unique name for the key pair.

  • publicKeyMaterial :: Base64

    The public key. For API calls, the text must be base64-encoded. For command line tools, base64 encoding is performed for you.

Instances

Instances details
ToHeaders ImportKeyPair Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

ToPath ImportKeyPair Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

ToQuery ImportKeyPair Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

AWSRequest ImportKeyPair Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

Associated Types

type AWSResponse ImportKeyPair #

Generic ImportKeyPair Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

Associated Types

type Rep ImportKeyPair :: Type -> Type #

Read ImportKeyPair Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

Show ImportKeyPair Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

NFData ImportKeyPair Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

Methods

rnf :: ImportKeyPair -> () #

Eq ImportKeyPair Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

Hashable ImportKeyPair Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

type AWSResponse ImportKeyPair Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

type Rep ImportKeyPair Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

type Rep ImportKeyPair = D1 ('MetaData "ImportKeyPair" "Amazonka.EC2.ImportKeyPair" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "ImportKeyPair'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "dryRun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "tagSpecifications") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [TagSpecification]))) :*: (S1 ('MetaSel ('Just "keyName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "publicKeyMaterial") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Base64))))

newImportKeyPair Source #

Create a value of ImportKeyPair with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:dryRun:ImportKeyPair', importKeyPair_dryRun - 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.

ImportKeyPair, importKeyPair_tagSpecifications - The tags to apply to the imported key pair.

ImportKeyPair, importKeyPair_keyName - A unique name for the key pair.

$sel:publicKeyMaterial:ImportKeyPair', importKeyPair_publicKeyMaterial - The public key. For API calls, the text must be base64-encoded. For command line tools, base64 encoding is performed for you.-- -- Note: This Lens automatically encodes and decodes Base64 data. -- The underlying isomorphism will encode to Base64 representation during -- serialisation, and decode from Base64 representation during deserialisation. -- This Lens accepts and returns only raw unencoded data.

Request Lenses

importKeyPair_dryRun :: Lens' ImportKeyPair (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.

importKeyPair_tagSpecifications :: Lens' ImportKeyPair (Maybe [TagSpecification]) Source #

The tags to apply to the imported key pair.

importKeyPair_keyName :: Lens' ImportKeyPair Text Source #

A unique name for the key pair.

importKeyPair_publicKeyMaterial :: Lens' ImportKeyPair ByteString Source #

The public key. For API calls, the text must be base64-encoded. For command line tools, base64 encoding is performed for you.-- -- Note: This Lens automatically encodes and decodes Base64 data. -- The underlying isomorphism will encode to Base64 representation during -- serialisation, and decode from Base64 representation during deserialisation. -- This Lens accepts and returns only raw unencoded data.

Destructuring the Response

data ImportKeyPairResponse Source #

See: newImportKeyPairResponse smart constructor.

Constructors

ImportKeyPairResponse' 

Fields

  • keyFingerprint :: Maybe Text
    • For RSA key pairs, the key fingerprint is the MD5 public key fingerprint as specified in section 4 of RFC 4716.
    • For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8.
  • keyName :: Maybe Text

    The key pair name that you provided.

  • keyPairId :: Maybe Text

    The ID of the resulting key pair.

  • tags :: Maybe [Tag]

    The tags applied to the imported key pair.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic ImportKeyPairResponse Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

Associated Types

type Rep ImportKeyPairResponse :: Type -> Type #

Read ImportKeyPairResponse Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

Show ImportKeyPairResponse Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

NFData ImportKeyPairResponse Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

Methods

rnf :: ImportKeyPairResponse -> () #

Eq ImportKeyPairResponse Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

type Rep ImportKeyPairResponse Source # 
Instance details

Defined in Amazonka.EC2.ImportKeyPair

type Rep ImportKeyPairResponse = D1 ('MetaData "ImportKeyPairResponse" "Amazonka.EC2.ImportKeyPair" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "ImportKeyPairResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "keyFingerprint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "keyName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "keyPairId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "tags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Tag])) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))))

newImportKeyPairResponse Source #

Create a value of ImportKeyPairResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

ImportKeyPairResponse, importKeyPairResponse_keyFingerprint - - For RSA key pairs, the key fingerprint is the MD5 public key fingerprint as specified in section 4 of RFC 4716.

  • For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8.

ImportKeyPair, importKeyPairResponse_keyName - The key pair name that you provided.

ImportKeyPairResponse, importKeyPairResponse_keyPairId - The ID of the resulting key pair.

ImportKeyPairResponse, importKeyPairResponse_tags - The tags applied to the imported key pair.

$sel:httpStatus:ImportKeyPairResponse', importKeyPairResponse_httpStatus - The response's http status code.

Response Lenses

importKeyPairResponse_keyFingerprint :: Lens' ImportKeyPairResponse (Maybe Text) Source #

  • For RSA key pairs, the key fingerprint is the MD5 public key fingerprint as specified in section 4 of RFC 4716.
  • For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8.

importKeyPairResponse_tags :: Lens' ImportKeyPairResponse (Maybe [Tag]) Source #

The tags applied to the imported key pair.