Getting Started
Installation
pip install capo-ec2-instance-connect
Usage
from capo_ec2_instance_connect import AsyncEC2InstanceConnectClient
async def main():
async with AsyncEC2InstanceConnectClient() as ec2_instance_connect:
# Example: call the send_serial_console_ssh_public_key operation
response = await ec2_instance_connect.send_serial_console_ssh_public_key()
print(response["request_id"])
Error Handling
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
from capo_ec2_instance_connect import AsyncEC2InstanceConnectClient
from capo_ec2_instance_connect.error import AuthException
async def main():
async with AsyncEC2InstanceConnectClient() as ec2_instance_connect:
try:
await ec2_instance_connect.send_serial_console_ssh_public_key()
except AuthException as e:
print(f"Error: {e}")
print(e.data) # additional error data
Retrying
The SDK retries failed operations automatically. Retry behaviour follows the Smithy specification: errors are retried based on their is_retryable and is_throttling_error attributes. Throttling errors use a longer base delay. Network-level failures (connection errors and timeouts) are also retried. Non-retryable errors, such as client errors without the @retryable trait, are raised immediately without further attempts.
The number of attempts defaults to 3 and can be changed at the client level via retry_max_attempts, or per call via config_overrides.
from capo_ec2_instance_connect import AsyncEC2InstanceConnectClient
async def main():
async with AsyncEC2InstanceConnectClient() as ec2_instance_connect:
# Default: 3 attempts for every operation
response = await ec2_instance_connect.send_serial_console_ssh_public_key()
# Override per operation
response = await ec2_instance_connect.send_serial_console_ssh_public_key(config_overrides={"retry_max_attempts": 5})
# Disable retries for this call
response = await ec2_instance_connect.send_serial_console_ssh_public_key(config_overrides={"retry_max_attempts": 1})
Release files for capo-ec2-instance-connect 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| capo_ec2_instance_connect-0.1.0.tar.gz | 48.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_ec2_instance_connect-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 117.8 kB
Release files / capo_ec2_instance_connect-0.1.0.tar.gz
| Download URL | capo_ec2_instance_connect-0.1.0.tar.gz |
|---|---|
| Size | 48.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6f2a400d5b1cf8146a882a3b153d73390a3b9f2356c83e925bb26a713618e92
|
|
BLAKE2b-256 checksum How to use checksums |
16526c68b0bcae5cbca65f76a15f0a8dcae637df1a58107d37518b83ce5e5e10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / capo_ec2_instance_connect-0.1.0-py3-none-any.whl
| Download URL | capo_ec2_instance_connect-0.1.0-py3-none-any.whl |
|---|---|
| Size | 69.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bf585fd7bdb4dbb29e0160ef58417d3233b5da7d5468b4ffe76ea7900ad52e6d
|
|
BLAKE2b-256 checksum How to use checksums |
5bd41db854ae64e630769e751f6e229e2de706a5e70828027d0e6442d49e36cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|