Method: Fog::Compute::AWS::Real#create_key_pair

Defined in:
lib/fog/compute/requests/aws/create_key_pair.rb

#create_key_pair(key_name) ⇒ Object

Create a new key pair

Parameters

  • key_name<~String> - Unique name for key pair.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘keyFingerprint’<~String> - SHA-1 digest of DER encoded private key

      • ‘keyMaterial’<~String> - Unencrypted encoded PEM private key

      • ‘keyName’<~String> - Name of key

      • ‘requestId’<~String> - Id of request

Amazon API Reference



22
23
24
25
26
27
28
# File 'lib/fog/compute/requests/aws/create_key_pair.rb', line 22

def create_key_pair(key_name)
  request(
    'Action'  => 'CreateKeyPair',
    'KeyName' => key_name,
    :parser   => Fog::Parsers::Compute::AWS::CreateKeyPair.new
  )
end