v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1422212.4 KB

Pushes an SSH public key to the specified EC2 instance for use by the specified user. The key remains for 60 seconds. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect.html">Connect to your Linux instance using EC2 Instance Connect</a> in the <i>Amazon EC2 User Guide</i>.

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

Headers

X-Amz-Target'AWSEC2InstanceConnectService.SendSSHPublicKey' required

Request body

InstanceIdstring required

The ID of the EC2 instance.

InstanceOSUserstring required

The OS user on the EC2 instance for whom the key can be used to authenticate.

SSHPublicKeystring required

The public key material. To use the public key, you must have the matching private key.

AvailabilityZonestring

The Availability Zone in which the EC2 instance was launched.

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.

Example response

{
  "RequestId": "abcd1234-abcd-1234-abcd-1234abcd1234",
  "Success": true
}
All 2 operations