Table of Contents
A low-level client representing AWS 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.
import boto3
client = boto3.client('ec2-instance-connect')
These are the available methods:
Check if an operation can be paginated.
Create a paginator for an operation.
Returns an object that can wait for some condition.
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 .
See also: AWS API Documentation
Request Syntax
response = client.send_serial_console_ssh_public_key(
InstanceId='string',
SerialPort=123,
SSHPublicKey='string'
)
[REQUIRED]
The ID of the EC2 instance.
The serial port of the EC2 instance. Currently only port 0 is supported.
Default: 0
[REQUIRED]
The public key material. To use the public key, you must have the matching private key. For information about the supported key formats and lengths, see Requirements for key pairs in the Amazon EC2 User Guide .
dict
Response Syntax
{
'RequestId': 'string',
'Success': True|False
}
Response Structure
(dict) --
RequestId (string) --
The ID of the request. Please provide this ID when contacting AWS Support for assistance.
Success (boolean) --
Is true if the request succeeds and an error otherwise.
Exceptions
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 .
See also: AWS API Documentation
Request Syntax
response = client.send_ssh_public_key(
InstanceId='string',
InstanceOSUser='string',
SSHPublicKey='string',
AvailabilityZone='string'
)
[REQUIRED]
The ID of the EC2 instance.
[REQUIRED]
The OS user on the EC2 instance for whom the key can be used to authenticate.
[REQUIRED]
The public key material. To use the public key, you must have the matching private key.
[REQUIRED]
The Availability Zone in which the EC2 instance was launched.
dict
Response Syntax
{
'RequestId': 'string',
'Success': True|False
}
Response Structure
(dict) --
RequestId (string) --
The ID of the request. Please provide this ID when contacting AWS Support for assistance.
Success (boolean) --
Is true if the request succeeds and an error otherwise.
Exceptions
The available paginators are: