Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Creates an ED25519 or 2048-bit RSA key pair with the specified name and in the specified PEM or PPK format. Amazon EC2 stores the public key and displays the private key for you to save to a file. The private key is returned as an unencrypted PEM encoded PKCS#1 private key or an unencrypted PPK formatted private key for use with PuTTY. If a key with the specified name already exists, Amazon EC2 returns an error.
The key pair returned to you is available only in the Amazon Web Services Region in which you create it. If you prefer, you can create your own key pair using a third-party tool and upload it to any Region using ImportKeyPair.
You can have up to 5,000 key pairs per Amazon Web Services Region.
For more information, see Amazon EC2 key pairs in the Amazon Elastic Compute Cloud User Guide.
Synopsis
- data CreateKeyPair = CreateKeyPair' {}
- newCreateKeyPair :: Text -> CreateKeyPair
- createKeyPair_dryRun :: Lens' CreateKeyPair (Maybe Bool)
- createKeyPair_keyFormat :: Lens' CreateKeyPair (Maybe KeyFormat)
- createKeyPair_keyType :: Lens' CreateKeyPair (Maybe KeyType)
- createKeyPair_tagSpecifications :: Lens' CreateKeyPair (Maybe [TagSpecification])
- createKeyPair_keyName :: Lens' CreateKeyPair Text
- data CreateKeyPairResponse = CreateKeyPairResponse' {
- keyPairId :: Maybe Text
- tags :: Maybe [Tag]
- httpStatus :: Int
- keyName :: Text
- keyFingerprint :: Text
- keyMaterial :: Sensitive Text
- newCreateKeyPairResponse :: Int -> Text -> Text -> Text -> CreateKeyPairResponse
- createKeyPairResponse_keyPairId :: Lens' CreateKeyPairResponse (Maybe Text)
- createKeyPairResponse_tags :: Lens' CreateKeyPairResponse (Maybe [Tag])
- createKeyPairResponse_httpStatus :: Lens' CreateKeyPairResponse Int
- createKeyPairResponse_keyName :: Lens' CreateKeyPairResponse Text
- createKeyPairResponse_keyFingerprint :: Lens' CreateKeyPairResponse Text
- createKeyPairResponse_keyMaterial :: Lens' CreateKeyPairResponse Text
Creating a Request
data CreateKeyPair Source #
See: newCreateKeyPair
smart constructor.
CreateKeyPair' | |
|
Instances
Create a value of CreateKeyPair
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:CreateKeyPair'
, createKeyPair_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
.
$sel:keyFormat:CreateKeyPair'
, createKeyPair_keyFormat
- The format of the key pair.
Default: pem
CreateKeyPair
, createKeyPair_keyType
- The type of key pair. Note that ED25519 keys are not supported for
Windows instances.
Default: rsa
CreateKeyPair
, createKeyPair_tagSpecifications
- The tags to apply to the new key pair.
CreateKeyPair
, createKeyPair_keyName
- A unique name for the key pair.
Constraints: Up to 255 ASCII characters
Request Lenses
createKeyPair_dryRun :: Lens' CreateKeyPair (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
.
createKeyPair_keyFormat :: Lens' CreateKeyPair (Maybe KeyFormat) Source #
The format of the key pair.
Default: pem
createKeyPair_keyType :: Lens' CreateKeyPair (Maybe KeyType) Source #
The type of key pair. Note that ED25519 keys are not supported for Windows instances.
Default: rsa
createKeyPair_tagSpecifications :: Lens' CreateKeyPair (Maybe [TagSpecification]) Source #
The tags to apply to the new key pair.
createKeyPair_keyName :: Lens' CreateKeyPair Text Source #
A unique name for the key pair.
Constraints: Up to 255 ASCII characters
Destructuring the Response
data CreateKeyPairResponse Source #
Describes a key pair.
See: newCreateKeyPairResponse
smart constructor.
CreateKeyPairResponse' | |
|
Instances
newCreateKeyPairResponse Source #
:: Int | |
-> Text | |
-> Text | |
-> Text | |
-> CreateKeyPairResponse |
Create a value of CreateKeyPairResponse
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:
CreateKeyPairResponse
, createKeyPairResponse_keyPairId
- The ID of the key pair.
CreateKeyPairResponse
, createKeyPairResponse_tags
- Any tags applied to the key pair.
$sel:httpStatus:CreateKeyPairResponse'
, createKeyPairResponse_httpStatus
- The response's http status code.
CreateKeyPair
, createKeyPairResponse_keyName
- The name of the key pair.
CreateKeyPairResponse
, createKeyPairResponse_keyFingerprint
- - For RSA key pairs, the key fingerprint is the SHA-1 digest of the
DER encoded private key.
- 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.
$sel:keyMaterial:CreateKeyPairResponse'
, createKeyPairResponse_keyMaterial
- An unencrypted PEM encoded RSA or ED25519 private key.
Response Lenses
createKeyPairResponse_keyPairId :: Lens' CreateKeyPairResponse (Maybe Text) Source #
The ID of the key pair.
createKeyPairResponse_tags :: Lens' CreateKeyPairResponse (Maybe [Tag]) Source #
Any tags applied to the key pair.
createKeyPairResponse_httpStatus :: Lens' CreateKeyPairResponse Int Source #
The response's http status code.
createKeyPairResponse_keyName :: Lens' CreateKeyPairResponse Text Source #
The name of the key pair.
createKeyPairResponse_keyFingerprint :: Lens' CreateKeyPairResponse Text Source #
- For RSA key pairs, the key fingerprint is the SHA-1 digest of the DER encoded private key.
- 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.
createKeyPairResponse_keyMaterial :: Lens' CreateKeyPairResponse Text Source #
An unencrypted PEM encoded RSA or ED25519 private key.