Skip to content

/AWS1/CL_EC2=>IMPORTKEYPAIR()

About ImportKeyPair

Imports the public key from an RSA or ED25519 key pair that you created with a third-party tool. Compare this with CreateKeyPair, in which Amazon Web Services creates the key pair and gives the keys to you (Amazon Web Services keeps a copy of the public key). With ImportKeyPair, you create the key pair and give Amazon Web Services just the public key. The private key is never transferred between you and Amazon Web Services.

For more information about key pairs, see Amazon EC2 key pairs in the Amazon Elastic Compute Cloud User Guide.

Method Signature

IMPORTING

Required arguments:

IV_KEYNAME TYPE /AWS1/EC2STRING /AWS1/EC2STRING

A unique name for the key pair.

IV_PUBLICKEYMATERIAL TYPE /AWS1/EC2BLOB /AWS1/EC2BLOB

The public key. For API calls, the text must be base64-encoded. For command line tools, base64 encoding is performed for you.

Optional arguments:

IV_DRYRUN TYPE /AWS1/EC2BOOLEAN /AWS1/EC2BOOLEAN

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.

IT_TAGSPECIFICATIONS TYPE /AWS1/CL_EC2TAGSPECIFICATION=>TT_TAGSPECIFICATIONLIST TT_TAGSPECIFICATIONLIST

The tags to apply to the imported key pair.

RETURNING

OO_OUTPUT TYPE REF TO /AWS1/CL_EC2IMPORTKEYPAIRRSLT /AWS1/CL_EC2IMPORTKEYPAIRRSLT