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
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.
client = boto3.client("ec2-instance-connect")
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)
from mypy_boto3_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 boto3.client("ec2-instance-connect").can_paginate
method.
boto3 documentation
close
Closes underlying endpoint connections.
Type annotations and code completion for boto3.client("ec2-instance-connect").close
method.
boto3 documentation
generate_presigned_url
Generate a presigned url given a client, its method, and arguments.
Type annotations and code completion for boto3.client("ec2-instance-connect").generate_presigned_url
method.
boto3 documentation
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 boto3.client("ec2-instance-connect").send_serial_console_ssh_public_key
method.
boto3 documentation
def send_serial_console_ssh_public_key(
self,
*,
InstanceId: str,
SSHPublicKey: str,
SerialPort: int = ...,
) -> SendSerialConsoleSSHPublicKeyResponseTypeDef: # (1)
...
kwargs: SendSerialConsoleSSHPublicKeyRequestRequestTypeDef = { # (1)
"InstanceId": ...,
"SSHPublicKey": ...,
}
parent.send_serial_console_ssh_public_key(**kwargs)
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
def send_ssh_public_key(
self,
*,
InstanceId: str,
InstanceOSUser: str,
SSHPublicKey: str,
AvailabilityZone: str = ...,
) -> SendSSHPublicKeyResponseTypeDef: # (1)
...