Skip to content

EC2InstanceConnectClient#

Index > EC2InstanceConnect > EC2InstanceConnectClient

Auto-generated documentation for EC2InstanceConnect type annotations stubs module mypy-boto3-ec2-instance-connect.

EC2InstanceConnectClient#

Type annotations and code completion for boto3.client("ec2-instance-connect"). boto3 documentation

# EC2InstanceConnectClient usage example

from boto3.session import Session
from mypy_boto3_ec2_instance_connect.client import EC2InstanceConnectClient

def get_ec2-instance-connect_client() -> EC2InstanceConnectClient:
    return Session().client("ec2-instance-connect")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("ec2-instance-connect").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("ec2-instance-connect")

try:
    do_something(client)
except (
    client.exceptions.AuthException,
    client.exceptions.ClientError,
    client.exceptions.EC2InstanceNotFoundException,
    client.exceptions.EC2InstanceStateInvalidException,
    client.exceptions.EC2InstanceTypeInvalidException,
    client.exceptions.EC2InstanceUnavailableException,
    client.exceptions.InvalidArgsException,
    client.exceptions.SerialConsoleAccessDisabledException,
    client.exceptions.SerialConsoleSessionLimitExceededException,
    client.exceptions.SerialConsoleSessionUnavailableException,
    client.exceptions.SerialConsoleSessionUnsupportedException,
    client.exceptions.ServiceException,
    client.exceptions.ThrottlingException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_ec2_instance_connect.client import Exceptions

def handle_error(exc: Exceptions.AuthException) -> None:
    ...

Methods#

can_paginate#

Type annotations and code completion for boto3.client("ec2-instance-connect").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

generate_presigned_url#

Type annotations and code completion for boto3.client("ec2-instance-connect").generate_presigned_url method. boto3 documentation

# generate_presigned_url method definition

def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

send_ssh_public_key#

Pushes an SSH public key to the specified EC2 instance for use by the specified user.

Type annotations and code completion for boto3.client("ec2-instance-connect").send_ssh_public_key method. boto3 documentation

# send_ssh_public_key method definition

def send_ssh_public_key(
    self,
    *,
    InstanceId: str,
    InstanceOSUser: str,
    SSHPublicKey: str,
    AvailabilityZone: str = ...,
) -> SendSSHPublicKeyResponseTypeDef:  # (1)
    ...
  1. See SendSSHPublicKeyResponseTypeDef
# send_ssh_public_key method usage example with argument unpacking

kwargs: SendSSHPublicKeyRequestRequestTypeDef = {  # (1)
    "InstanceId": ...,
    "InstanceOSUser": ...,
    "SSHPublicKey": ...,
}

parent.send_ssh_public_key(**kwargs)
  1. See SendSSHPublicKeyRequestRequestTypeDef

send_serial_console_ssh_public_key#

Pushes an SSH public key to the specified EC2 instance.

Type annotations and code completion for boto3.client("ec2-instance-connect").send_serial_console_ssh_public_key method. boto3 documentation

# send_serial_console_ssh_public_key method definition

def send_serial_console_ssh_public_key(
    self,
    *,
    InstanceId: str,
    SSHPublicKey: str,
    SerialPort: int = ...,
) -> SendSerialConsoleSSHPublicKeyResponseTypeDef:  # (1)
    ...
  1. See SendSerialConsoleSSHPublicKeyResponseTypeDef
# send_serial_console_ssh_public_key method usage example with argument unpacking

kwargs: SendSerialConsoleSSHPublicKeyRequestRequestTypeDef = {  # (1)
    "InstanceId": ...,
    "SSHPublicKey": ...,
}

parent.send_serial_console_ssh_public_key(**kwargs)
  1. See SendSerialConsoleSSHPublicKeyRequestRequestTypeDef