AWS EC2 Instance Connect

2019/06/27 - AWS EC2 Instance Connect - 1 new api methods

Changes  Amazon EC2 Instance Connect is a simple and secure way to connect to your instances using Secure Shell (SSH). With EC2 Instance Connect, you can control SSH access to your instances using AWS Identity and Access Management (IAM) policies as well as audit connection requests with AWS CloudTrail events. In addition, you can leverage your existing SSH keys or further enhance your security posture by generating one-time use SSH keys each time an authorized user connects.

SendSSHPublicKey (new) Link ΒΆ

Pushes an SSH public key to a particular OS user on a given EC2 instance for 60 seconds.

See also: AWS API Documentation

Request Syntax

client.send_ssh_public_key(
    InstanceId='string',
    InstanceOSUser='string',
    SSHPublicKey='string',
    AvailabilityZone='string'
)
type InstanceId

string

param InstanceId

[REQUIRED]

The EC2 instance you wish to publish the SSH key to.

type InstanceOSUser

string

param InstanceOSUser

[REQUIRED]

The OS user on the EC2 instance whom the key may be used to authenticate as.

type SSHPublicKey

string

param SSHPublicKey

[REQUIRED]

The public key to be published to the instance. To use it after publication you must have the matching private key.

type AvailabilityZone

string

param AvailabilityZone

[REQUIRED]

The availability zone the EC2 instance was launched in.

rtype

dict

returns

Response Syntax

{
    'RequestId': 'string',
    'Success': True|False
}

Response Structure

  • (dict) --

    • RequestId (string) --

      The request ID as logged by EC2 Connect. Please provide this when contacting AWS Support.

    • Success (boolean) --

      Indicates request success.