Skip to content

/AWS1/CL_EC2=>IMPORTKEYPAIR()

About ImportKeyPair

Imports the public key from an RSA or ED25519 key pair that you created using a third-party tool. You give Amazon Web Services only the public key. The private key is never transferred between you and Amazon Web Services.

For more information about the requirements for importing a key pair, see Create a key pair and import the public key to Amazon EC2 in the Amazon EC2 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.

Optional arguments:

IT_TAGSPECIFICATIONS TYPE /AWS1/CL_EC2TAGSPECIFICATION=>TT_TAGSPECIFICATIONLIST TT_TAGSPECIFICATIONLIST

The tags to apply to the imported key pair.

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.

RETURNING

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