Interface Ec2InstanceConnectClient
-
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
@Generated("software.amazon.awssdk:codegen") @ThreadSafe public interface Ec2InstanceConnectClient extends AwsClient
Service client for accessing EC2 Instance Connect. This can be created using the staticbuilder()method.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.
-
-
Field Summary
Fields Modifier and Type Field Description static StringSERVICE_METADATA_IDValue for looking up the service's metadata from theServiceMetadataProvider.static StringSERVICE_NAME
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static Ec2InstanceConnectClientBuilderbuilder()Create a builder that can be used to configure and create aEc2InstanceConnectClient.static Ec2InstanceConnectClientcreate()Create aEc2InstanceConnectClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default SendSerialConsoleSshPublicKeyResponsesendSerialConsoleSSHPublicKey(Consumer<SendSerialConsoleSshPublicKeyRequest.Builder> sendSerialConsoleSshPublicKeyRequest)Pushes an SSH public key to the specified EC2 instance.default SendSerialConsoleSshPublicKeyResponsesendSerialConsoleSSHPublicKey(SendSerialConsoleSshPublicKeyRequest sendSerialConsoleSshPublicKeyRequest)Pushes an SSH public key to the specified EC2 instance.default SendSshPublicKeyResponsesendSSHPublicKey(Consumer<SendSshPublicKeyRequest.Builder> sendSshPublicKeyRequest)Pushes an SSH public key to the specified EC2 instance for use by the specified user.default SendSshPublicKeyResponsesendSSHPublicKey(SendSshPublicKeyRequest sendSshPublicKeyRequest)Pushes an SSH public key to the specified EC2 instance for use by the specified user.default Ec2InstanceConnectServiceClientConfigurationserviceClientConfiguration()static ServiceMetadataserviceMetadata()-
Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
-
Methods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
-
-
-
Field Detail
-
SERVICE_NAME
static final String SERVICE_NAME
- See Also:
- Constant Field Values
-
SERVICE_METADATA_ID
static final String SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider.- See Also:
- Constant Field Values
-
-
Method Detail
-
sendSSHPublicKey
default SendSshPublicKeyResponse sendSSHPublicKey(SendSshPublicKeyRequest sendSshPublicKeyRequest) throws AuthException, InvalidArgsException, ServiceException, ThrottlingException, Ec2InstanceNotFoundException, Ec2InstanceStateInvalidException, Ec2InstanceUnavailableException, 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.
- Parameters:
sendSshPublicKeyRequest-- Returns:
- Result of the SendSSHPublicKey operation returned by the service.
- Throws:
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.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- See Also:
- AWS API Documentation
-
sendSSHPublicKey
default SendSshPublicKeyResponse sendSSHPublicKey(Consumer<SendSshPublicKeyRequest.Builder> sendSshPublicKeyRequest) throws AuthException, InvalidArgsException, ServiceException, ThrottlingException, Ec2InstanceNotFoundException, Ec2InstanceStateInvalidException, Ec2InstanceUnavailableException, 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.Builderavoiding the need to create one manually viaSendSshPublicKeyRequest.builder()- Parameters:
sendSshPublicKeyRequest- AConsumerthat will call methods onSendSshPublicKeyRequest.Builderto create a request.- Returns:
- Result of the SendSSHPublicKey operation returned by the service.
- Throws:
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.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- See Also:
- AWS API Documentation
-
sendSerialConsoleSSHPublicKey
default SendSerialConsoleSshPublicKeyResponse sendSerialConsoleSSHPublicKey(SendSerialConsoleSshPublicKeyRequest sendSerialConsoleSshPublicKeyRequest) throws AuthException, SerialConsoleAccessDisabledException, InvalidArgsException, ServiceException, ThrottlingException, Ec2InstanceNotFoundException, Ec2InstanceTypeInvalidException, SerialConsoleSessionLimitExceededException, SerialConsoleSessionUnavailableException, Ec2InstanceStateInvalidException, Ec2InstanceUnavailableException, SerialConsoleSessionUnsupportedException, 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.
- Parameters:
sendSerialConsoleSshPublicKeyRequest-- Returns:
- Result of the SendSerialConsoleSSHPublicKey operation returned by the service.
- Throws:
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.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- See Also:
- AWS API Documentation
-
sendSerialConsoleSSHPublicKey
default SendSerialConsoleSshPublicKeyResponse sendSerialConsoleSSHPublicKey(Consumer<SendSerialConsoleSshPublicKeyRequest.Builder> sendSerialConsoleSshPublicKeyRequest) throws AuthException, SerialConsoleAccessDisabledException, InvalidArgsException, ServiceException, ThrottlingException, Ec2InstanceNotFoundException, Ec2InstanceTypeInvalidException, SerialConsoleSessionLimitExceededException, SerialConsoleSessionUnavailableException, Ec2InstanceStateInvalidException, Ec2InstanceUnavailableException, SerialConsoleSessionUnsupportedException, 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.Builderavoiding the need to create one manually viaSendSerialConsoleSshPublicKeyRequest.builder()- Parameters:
sendSerialConsoleSshPublicKeyRequest- AConsumerthat will call methods onSendSerialConsoleSshPublicKeyRequest.Builderto create a request.- Returns:
- Result of the SendSerialConsoleSSHPublicKey operation returned by the service.
- Throws:
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.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- See Also:
- AWS API Documentation
-
create
static Ec2InstanceConnectClient create()
Create aEc2InstanceConnectClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.
-
builder
static Ec2InstanceConnectClientBuilder builder()
Create a builder that can be used to configure and create aEc2InstanceConnectClient.
-
serviceMetadata
static ServiceMetadata serviceMetadata()
-
serviceClientConfiguration
default Ec2InstanceConnectServiceClientConfiguration serviceClientConfiguration()
- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient
-
-