v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1422212.4 KB

Pushes an SSH public key to the specified EC2 instance. The key remains for 60 seconds, which gives you 60 seconds to establish a serial console connection to the instance using SSH. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-serial-console.html">EC2 Serial Console</a> in the <i>Amazon EC2 User Guide</i>.

post/#X-Amz-Target=AWSEC2InstanceConnectService.SendSerialConsoleSSHPublicKey

Headers

X-Amz-Target'AWSEC2InstanceConnectService.SendSerialConsoleSSHPublicKey' required

Request body

InstanceIdstring required

The ID of the EC2 instance.

SerialPortinteger
<p>The serial port of the EC2 instance. Currently only port 0 is supported.</p> <p>Default: 0</p>
SSHPublicKeystring required

The public key material. To use the public key, you must have the matching private key. For information about the supported key formats and lengths, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#how-to-generate-your-own-key-and-import-it-to-aws">Requirements for key pairs</a> in the <i>Amazon EC2 User Guide</i>.

Response

Success

RequestIdstring

The ID of the request. Please provide this ID when contacting AWS Support for assistance.

Successboolean

Is true if the request succeeds and an error otherwise.