@Generated(value="software.amazon.awssdk:codegen") public interface Ec2InstanceConnectClient extends SdkClient
builder()
method.
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.
Modifier and Type | Field and Description |
---|---|
static String |
SERVICE_METADATA_ID
Value for looking up the service's metadata from the
ServiceMetadataProvider . |
static String |
SERVICE_NAME |
Modifier and Type | Method and Description |
---|---|
static Ec2InstanceConnectClientBuilder |
builder()
Create a builder that can be used to configure and create a
Ec2InstanceConnectClient . |
static Ec2InstanceConnectClient |
create()
Create a
Ec2InstanceConnectClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider . |
default SendSerialConsoleSshPublicKeyResponse |
sendSerialConsoleSSHPublicKey(Consumer<SendSerialConsoleSshPublicKeyRequest.Builder> sendSerialConsoleSshPublicKeyRequest)
Pushes an SSH public key to the specified EC2 instance.
|
default SendSerialConsoleSshPublicKeyResponse |
sendSerialConsoleSSHPublicKey(SendSerialConsoleSshPublicKeyRequest sendSerialConsoleSshPublicKeyRequest)
Pushes an SSH public key to the specified EC2 instance.
|
default SendSshPublicKeyResponse |
sendSSHPublicKey(Consumer<SendSshPublicKeyRequest.Builder> sendSshPublicKeyRequest)
Pushes an SSH public key to the specified EC2 instance for use by the specified user.
|
default SendSshPublicKeyResponse |
sendSSHPublicKey(SendSshPublicKeyRequest sendSshPublicKeyRequest)
Pushes an SSH public key to the specified EC2 instance for use by the specified user.
|
static ServiceMetadata |
serviceMetadata() |
serviceName
close
static final String SERVICE_NAME
static final String SERVICE_METADATA_ID
ServiceMetadataProvider
.static Ec2InstanceConnectClient create()
Ec2InstanceConnectClient
with the region loaded from the
DefaultAwsRegionProviderChain
and credentials loaded from the
DefaultCredentialsProvider
.static Ec2InstanceConnectClientBuilder builder()
Ec2InstanceConnectClient
.default SendSshPublicKeyResponse sendSSHPublicKey(SendSshPublicKeyRequest sendSshPublicKeyRequest) throws AuthException, InvalidArgsException, ServiceException, ThrottlingException, Ec2InstanceNotFoundException, AwsServiceException, SdkClientException, Ec2InstanceConnectException
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.
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.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.Ec2InstanceConnectException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default SendSshPublicKeyResponse sendSSHPublicKey(Consumer<SendSshPublicKeyRequest.Builder> sendSshPublicKeyRequest) throws AuthException, InvalidArgsException, ServiceException, ThrottlingException, Ec2InstanceNotFoundException, AwsServiceException, SdkClientException, Ec2InstanceConnectException
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.
This is a convenience which creates an instance of the SendSshPublicKeyRequest.Builder
avoiding the need
to create one manually via SendSshPublicKeyRequest.builder()
sendSshPublicKeyRequest
- A Consumer
that will call methods on SendSSHPublicKeyRequest.Builder
to create a request.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.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.Ec2InstanceConnectException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default SendSerialConsoleSshPublicKeyResponse sendSerialConsoleSSHPublicKey(SendSerialConsoleSshPublicKeyRequest sendSerialConsoleSshPublicKeyRequest) throws AuthException, SerialConsoleAccessDisabledException, InvalidArgsException, ServiceException, ThrottlingException, Ec2InstanceNotFoundException, Ec2InstanceTypeInvalidException, SerialConsoleSessionLimitExceededException, SerialConsoleSessionUnavailableException, AwsServiceException, SdkClientException, Ec2InstanceConnectException
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.
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.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.Ec2InstanceConnectException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default SendSerialConsoleSshPublicKeyResponse sendSerialConsoleSSHPublicKey(Consumer<SendSerialConsoleSshPublicKeyRequest.Builder> sendSerialConsoleSshPublicKeyRequest) throws AuthException, SerialConsoleAccessDisabledException, InvalidArgsException, ServiceException, ThrottlingException, Ec2InstanceNotFoundException, Ec2InstanceTypeInvalidException, SerialConsoleSessionLimitExceededException, SerialConsoleSessionUnavailableException, AwsServiceException, SdkClientException, Ec2InstanceConnectException
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.
This is a convenience which creates an instance of the SendSerialConsoleSshPublicKeyRequest.Builder
avoiding the need to create one manually via SendSerialConsoleSshPublicKeyRequest.builder()
sendSerialConsoleSshPublicKeyRequest
- A Consumer
that will call methods on SendSerialConsoleSSHPublicKeyRequest.Builder
to
create a request.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.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.Ec2InstanceConnectException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
static ServiceMetadata serviceMetadata()