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 EC2 Serial Console in
the Amazon EC2 User Guide.
example
Use a bare-bones client and the command you need to make an API call.
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 EC2 Serial Console in the Amazon EC2 User Guide.
Use a bare-bones client and the command you need to make an API call.
import { EC2InstanceConnectClient, SendSerialConsoleSSHPublicKeyCommand } from "@aws-sdk/client-ec2-instance-connect"; // ES Modules import // const { EC2InstanceConnectClient, SendSerialConsoleSSHPublicKeyCommand } = require("@aws-sdk/client-ec2-instance-connect"); // CommonJS import const client = new EC2InstanceConnectClient(config); const command = new SendSerialConsoleSSHPublicKeyCommand(input); const response = await client.send(command);
SendSerialConsoleSSHPublicKeyCommandInput for command's
input
shape.SendSerialConsoleSSHPublicKeyCommandOutput for command's
response
shape.config for EC2InstanceConnectClient's
config
shape.