You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::EC2::KeyPair

Inherits:
Resources::Resource show all
Defined in:
(unknown)

Instance Attribute Summary collapse

Attributes inherited from Resources::Resource

#client, #identifiers

Instance Method Summary collapse

Methods inherited from Resources::Resource

add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until

Methods included from Resources::OperationMethods

#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations

Constructor Details

#initialize(name, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object

Overloads:

  • #initialize(name, options = {}) ⇒ Object

    Parameters:

    • name (String)

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :name (required, String)
    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

Instance Attribute Details

#key_fingerprintString (readonly)

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

Returns:

  • (String)

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

#key_materialString (readonly)

An unencrypted PEM encoded RSA private key.

Returns:

  • (String)

    An unencrypted PEM encoded RSA private key.

#key_nameString (readonly)

The name of the key pair.

Returns:

  • (String)

    The name of the key pair.

#nameString (readonly)

Returns:

  • (String)

Instance Method Details

#delete(options = {}) ⇒ Struct

Deletes the specified key pair, by removing the public key from Amazon EC2.

Examples:

Request syntax example with placeholder values


keypair.delete({
  dry_run: false,
})

Options Hash (options):

  • :dry_run (Boolean)

    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.

Returns:

  • (Struct)

    Returns an empty response.

See Also: