Skip to content

EC2InstanceConnectClient

Index > EC2InstanceConnect > EC2InstanceConnectClient

Auto-generated documentation for EC2InstanceConnect type annotations stubs module types-aiobotocore-ec2-instance-connect.

EC2InstanceConnectClient

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

Usage example
from aioboto3.session import Session
from types_aiobotocore_ec2_instance_connect.client import EC2InstanceConnectClient

session = Session()
async with session.client("ec2-instance-connect") as client:
    client: EC2InstanceConnectClient

Exceptions

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

Usage example
async with session.client("ec2-instance-connect") as client:
    try:
        do_something(client)
    except (
            client.AuthException,
        client.ClientError,
        client.EC2InstanceNotFoundException,
        client.EC2InstanceStateInvalidException,
        client.EC2InstanceTypeInvalidException,
        client.EC2InstanceUnavailableException,
        client.InvalidArgsException,
        client.SerialConsoleAccessDisabledException,
        client.SerialConsoleSessionLimitExceededException,
        client.SerialConsoleSessionUnavailableException,
        client.ServiceException,
        client.ThrottlingException,
    ) as e:
        print(e)
Type checking example
from types_aiobotocore_ec2_instance_connect.client import Exceptions

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

Methods

can_paginate

Check if an operation can be paginated.

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

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

close

Closes underlying endpoint connections.

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

Method definition
await def close(
    self,
) -> None:
    ...

generate_presigned_url

Generate a presigned url given a client, its method, and arguments.

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

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

send_serial_console_ssh_public_key

Pushes an SSH public key to the specified EC2 instance.

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

Method definition
await def send_serial_console_ssh_public_key(
    self,
    *,
    InstanceId: str,
    SSHPublicKey: str,
    SerialPort: int = ...,
) -> SendSerialConsoleSSHPublicKeyResponseTypeDef:  # (1)
    ...
  1. See SendSerialConsoleSSHPublicKeyResponseTypeDef
Usage example with kwargs
kwargs: SendSerialConsoleSSHPublicKeyRequestRequestTypeDef = {  # (1)
    "InstanceId": ...,
    "SSHPublicKey": ...,
}

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

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 session.client("ec2-instance-connect").send_ssh_public_key method. boto3 documentation

Method definition
await def send_ssh_public_key(
    self,
    *,
    InstanceId: str,
    InstanceOSUser: str,
    SSHPublicKey: str,
    AvailabilityZone: str = ...,
) -> SendSSHPublicKeyResponseTypeDef:  # (1)
    ...
  1. See SendSSHPublicKeyResponseTypeDef
Usage example with kwargs
kwargs: SendSSHPublicKeyRequestRequestTypeDef = {  # (1)
    "InstanceId": ...,
    "InstanceOSUser": ...,
    "SSHPublicKey": ...,
}

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

__aenter__

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

Method definition
await def __aenter__(
    self,
) -> EC2InstanceConnectClient:
    ...

__aexit__

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

Method definition
await def __aexit__(
    self,
    exc_type: Any,
    exc_val: Any,
    exc_tb: Any,
) -> Any:
    ...