class AWS::EC2::KeyPair
private key
@attr_reader [String] fingerprint A SHA-1 digest of the DER encoded
Represents an EC2 key pair.
def delete
-
(true)
-
def delete client.delete_key_pair(:key_name => name) true end
def exists?
-
(Boolean)
- True if the key pair exists.
def exists? resp = client.describe_key_pairs(:filters => [ { :name => "key-name", :values => [name] } ]) !resp.key_set.empty? end
def find_in_response(resp)
def find_in_response(resp) resp.key_index[name] end
def initialize name, options = {}
def initialize name, options = {} @name = name.to_s @private_key = options[:private_key] super end
def private_key
-
(String)
- An unencrypted PEM encoded RSA private key.
Other tags:
- Note: - Only call this method on newly created keys.
Other tags:
- See: KeyPairCollection#import -
def private_key unless @private_key raise 'you can only get the private key for just-created keypairs' end @private_key end
def response_id_method
def response_id_method :key_name end