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.create_client("ec2-instance-connect") boto3 documentation

EC2InstanceConnectClient usage example

from aiobotocore.session import get_session
from types_aiobotocore_ec2_instance_connect.client import EC2InstanceConnectClient

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

Exceptions#

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

EC2InstanceConnectClient.exceptions usage example

async with session.create_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)
EC2InstanceConnectClient usage 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.create_client("ec2-instance-connect").can_paginate method. boto3 documentation

# can_paginate method definition

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

close#

Closes underlying endpoint connections.

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

# close 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.create_client("ec2-instance-connect").generate_presigned_url method. boto3 documentation

# generate_presigned_url 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.create_client("ec2-instance-connect").send_serial_console_ssh_public_key method. boto3 documentation

# send_serial_console_ssh_public_key method definition

await 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

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

# send_ssh_public_key method definition

await 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

__aenter__#

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

# __aenter__ method definition

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

__aexit__#

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

# __aexit__ method definition

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