@ThreadSafe @Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class AWSEC2InstanceConnectClient extends AmazonWebServiceClient implements AWSEC2InstanceConnect
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.
LOGGING_AWS_REQUEST_METRIC
ENDPOINT_PREFIX
Modifier and Type | Method and Description |
---|---|
static AWSEC2InstanceConnectClientBuilder |
builder() |
ResponseMetadata |
getCachedResponseMetadata(AmazonWebServiceRequest request)
Returns additional metadata for a previously executed successful, request, typically used for debugging issues
where a service isn't acting as expected.
|
SendSerialConsoleSSHPublicKeyResult |
sendSerialConsoleSSHPublicKey(SendSerialConsoleSSHPublicKeyRequest request)
Pushes an SSH public key to the specified EC2 instance.
|
SendSSHPublicKeyResult |
sendSSHPublicKey(SendSSHPublicKeyRequest request)
Pushes an SSH public key to the specified EC2 instance for use by the specified user.
|
void |
shutdown()
Shuts down this client object, releasing any resources that might be held
open.
|
addRequestHandler, addRequestHandler, configureRegion, getClientConfiguration, getEndpointPrefix, getMonitoringListeners, getRequestMetricsCollector, getServiceName, getSignerByURI, getSignerOverride, getSignerRegionOverride, getTimeOffset, makeImmutable, removeRequestHandler, removeRequestHandler, setEndpoint, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, withEndpoint, withRegion, withRegion, withTimeOffset
public static AWSEC2InstanceConnectClientBuilder builder()
public SendSSHPublicKeyResult sendSSHPublicKey(SendSSHPublicKeyRequest request)
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 Connect to your Linux instance using EC2 Instance Connect in the Amazon EC2 User Guide.
sendSSHPublicKey
in interface AWSEC2InstanceConnect
sendSSHPublicKeyRequest
- AuthException
- Either your AWS credentials are not valid or you do not have access to the EC2 instance.InvalidArgsException
- One of the parameters is not valid.ServiceException
- The service encountered an error. Follow the instructions in the error message and try again.ThrottlingException
- The requests were made too frequently and have been throttled. Wait a while and try again. To increase
the limit on your request frequency, contact AWS Support.EC2InstanceNotFoundException
- The specified instance was not found.EC2InstanceStateInvalidException
- Unable to connect because the instance is not in a valid state. Connecting to a stopped or terminated
instance is not supported. If the instance is stopped, start your instance, and try to connect again.EC2InstanceUnavailableException
- The instance is currently unavailable. Wait a few minutes and try again.public SendSerialConsoleSSHPublicKeyResult sendSerialConsoleSSHPublicKey(SendSerialConsoleSSHPublicKeyRequest 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.
sendSerialConsoleSSHPublicKey
in interface AWSEC2InstanceConnect
sendSerialConsoleSSHPublicKeyRequest
- AuthException
- Either your AWS credentials are not valid or you do not have access to the EC2 instance.SerialConsoleAccessDisabledException
- Your account is not authorized to use the EC2 Serial Console. To authorize your account, run the
EnableSerialConsoleAccess API. For more information, see EnableSerialConsoleAccess in the Amazon EC2 API Reference.InvalidArgsException
- One of the parameters is not valid.ServiceException
- The service encountered an error. Follow the instructions in the error message and try again.ThrottlingException
- The requests were made too frequently and have been throttled. Wait a while and try again. To increase
the limit on your request frequency, contact AWS Support.EC2InstanceNotFoundException
- The specified instance was not found.EC2InstanceTypeInvalidException
- The instance type is not supported for connecting via the serial console. Only Nitro instance types are
currently supported.SerialConsoleSessionLimitExceededException
- The instance currently has 1 active serial console session. Only 1 session is supported at a time.SerialConsoleSessionUnavailableException
- Unable to start a serial console session. Please try again.EC2InstanceStateInvalidException
- Unable to connect because the instance is not in a valid state. Connecting to a stopped or terminated
instance is not supported. If the instance is stopped, start your instance, and try to connect again.EC2InstanceUnavailableException
- The instance is currently unavailable. Wait a few minutes and try again.SerialConsoleSessionUnsupportedException
- Your instance's BIOS version is unsupported for serial console connection. Reboot your instance to update
its BIOS, and then try again to connect.public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing the request.
getCachedResponseMetadata
in interface AWSEC2InstanceConnect
request
- The originally executed requestpublic void shutdown()
AmazonWebServiceClient
shutdown
in interface AWSEC2InstanceConnect
shutdown
in class AmazonWebServiceClient