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

Class: Aws::EC2::KeyPairInfo

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)

If you used CreateKeyPair to create the key pair, this is the SHA-1 digest of the DER encoded private key. If you used ImportKeyPair to provide AWS the public key, this is the MD5 public key fingerprint as specified in section 4 of RFC4716.

Returns:

  • (String)

    If you used CreateKeyPair to create the key pair, this is the SHA-1 digest of the DER encoded private key.

#key_nameString (readonly)

The name of the key pair.

Returns:

  • (String)

    The name of the key pair.

#key_pair_idString (readonly)

The ID of the key pair.

Returns:

  • (String)

    The ID of the key pair.

#nameString (readonly)

Returns:

  • (String)

#tagsArray<Types::Tag> (readonly)

Any tags applied to the key pair.

Returns:

  • (Array<Types::Tag>)

    Any tags applied to the key pair.

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


keypairinfo.delete({
  key_pair_id: "KeyPairId",
  dry_run: false,
})

Options Hash (options):

  • :key_pair_id (String)

    The ID of the key pair.

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