AWS.EC2InstanceConnect — AWS SDK for JavaScript (original) (raw)

We recommend that you migrate to AWS SDK for JavaScript v3. For dates, additional details, and information on how to migrate, please refer to the linked announcement.

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

This is the Amazon EC2 Instance Connect API Reference. It provides descriptions, syntax, and usage examples for each of the actions for Amazon EC2 Instance Connect. Amazon EC2 Instance Connect enables system administrators to publish one-time use SSH public keys to EC2, providing users a simple and secure way to connect to their instances.

To view the Amazon EC2 Instance Connect content in the Amazon EC2 User Guide, see Connect to your Linux instance using EC2 Instance Connect.

For Amazon EC2 APIs, see the Amazon EC2 API Reference.

Sending a Request Using EC2InstanceConnect

var ec2instanceconnect = new AWS.EC2InstanceConnect();
ec2instanceconnect.sendSSHPublicKey(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the EC2InstanceConnect object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var ec2instanceconnect = new AWS.EC2InstanceConnect({apiVersion: '2018-04-02'});

You can also set the API version globally in AWS.config.apiVersions using the ec2instanceconnect service identifier:

AWS.config.apiVersions = {
  ec2instanceconnect: '2018-04-02',
  // other service API versions
};

var ec2instanceconnect = new AWS.EC2InstanceConnect();

Constructor Summarycollapse

Property Summarycollapse

Properties inherited from AWS.Service

apiVersions

Method Summarycollapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.EC2InstanceConnect(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Property Details

endpointAWS.Endpoint

Returns an Endpoint object representing the endpoint URL for service requests.

Method Details

sendSerialConsoleSSHPublicKey(params = {}, callback) ⇒ AWS.Request

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.

sendSSHPublicKey(params = {}, callback) ⇒ AWS.Request