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.