
Aws Sdk Python Usage
Configure boto3 and botocore clients with merged Config objects for retries, timeouts, and connection pooling when wiring AWS APIs in Python agents or backends.
Overview
aws-sdk-python-usage is an agent skill for the Build phase that documents how to configure boto3 clients with botocore Config for retries, timeouts, and connection pools.
Install
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill aws-sdk-python-usageWhat is this skill?
- Documents botocore.config.Config merge semantics for layered client settings
- Covers retry modes legacy, standard, and adaptive with total_max_attempts vs max_attempts
- Maps connect_timeout, read_timeout, and max_pool_connections tuning
- Notes AWS_MAX_ATTEMPTS, AWS_RETRY_MODE, and ~/.aws/config overrides
- Documents three retry modes: legacy (5 attempts), standard (3), adaptive (3)
Adoption & trust: 1.3k installs on skills.sh; 819 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your Python AWS integration uses default boto3 settings and you get opaque throttling, long hangs, or too few pooled connections under load.
Who is it for?
Indie builders shipping Python agents, Lambdas, or APIs that call multiple AWS services and need copy-paste-safe client configuration patterns.
Skip if: Teams that only need high-level CDK or Terraform and never touch boto3 client code, or non-Python AWS stacks.
When should I use this skill?
Implementing or hardening Python boto3 clients for AWS service calls.
What do I get? / Deliverables
You merge explicit Config objects so each boto3 client has intentional retry mode, timeouts, and pool size aligned with your service limits.
- Configured boto3 client instantiation patterns
- Merged Config snippets for service-specific options
Recommended Skills
Journey fit
AWS SDK client tuning happens while implementing cloud integrations, before production hardening. The skill is a reference for boto3 client configuration during third-party and cloud service hookups, which maps to integrations.
How it compares
Reference prose for botocore Config—not an MCP server or a deploy skill; pair with IaC skills for infra provisioning.
Common Questions / FAQ
Who is aws-sdk-python-usage for?
Solo and indie developers writing Python against AWS with boto3 who want agent-guided defaults for retries, timeouts, and connection pooling.
When should I use aws-sdk-python-usage?
During Build integrations when creating S3, DynamoDB, or other boto3 clients, and during Operate iterate when tuning SDK behavior after observing timeouts or retry storms in production.
Is aws-sdk-python-usage safe to install?
It is documentation-style guidance without shell or network hooks in the skill itself; review the Security Audits panel on this Prism page before installing any toolkit bundle.
SKILL.md
READMESKILL.md - Aws Sdk Python Usage
# Client Configuration Reference ## botocore.config.Config All configuration is passed via `botocore.config.Config`. Multiple configs can be merged: ```python from botocore.config import Config base = Config(retries={"total_max_attempts": 2, "mode": "standard"}) s3_specific = Config(s3={"addressing_style": "path"}) # Merge -- later config wins on conflicts client = boto3.client("s3", config=base.merge(s3_specific)) ``` ## Retry Configuration ```python config = Config( retries={ "total_max_attempts": 2, # total attempts including first try (1 retry attempt here) "mode": "adaptive", # legacy | standard | adaptive } ) ``` Prefer using `total_max_attempts` over the legacy `max_attempts`. The `max_attempts` value does not include the first attempt (it's actually the number of retry attempts). | Mode | Default attempts | Behavior | |---|---|---| | `legacy` | 5 | Retries on a limited set of errors | | `standard` | 3 | Broader retryable errors, consistent exponential backoff | | `adaptive` | 3 | Standard + client-side rate limiting (token bucket) | Can also set via `AWS_MAX_ATTEMPTS` and `AWS_RETRY_MODE` env vars or `~/.aws/config`. ## Timeouts ```python config = Config( connect_timeout=5, # seconds to establish connection (default 60) read_timeout=10, # seconds to wait for response data (default 60) ) ``` ## Connection Pool ```python config = Config( max_pool_connections=50, # default 10 per client ) ``` Each client maintains its own urllib3 connection pool. If you're making parallel requests (e.g. with `concurrent.futures`), set `max_pool_connections` to match your concurrency level to avoid connection churn. ## Custom Endpoints ```python # Custom S3 endpoint on localhost. client = boto3.client( "s3", endpoint_url="http://localhost:4566", region_name="us-east-1", ) # FIPS endpoints config = Config(use_fips_endpoint=True) client = boto3.client("s3", config=config) # Dual-stack (IPv4 + IPv6) config = Config(use_dualstack_endpoint=True) client = boto3.client("s3", config=config) ``` ## Proxy Configuration ```python # Via environment variables (preferred) # HTTP_PROXY=http://proxy:8080 # HTTPS_PROXY=http://proxy:8080 # Via Config config = Config( proxies={"https": "http://proxy:8080"}, proxies_config={"proxy_ca_bundle": "/path/to/ca-bundle.crt"}, ) ``` ## S3-Specific Configuration ```python config = Config( s3={ "addressing_style": "path", # path | virtual | auto (default) "payload_signing_enabled": False, # skip payload signing for large uploads "us_east_1_regional_endpoint": "regional", }, signature_version="s3v4", ) # Transfer acceleration config = Config(s3={"use_accelerate_endpoint": True}) ``` ## User-Agent Customization ```python config = Config( user_agent_appid="my-app/1.0", user_agent_extra="custom-metadata", ) ``` ## Sharing Config Across Clients ```python from botocore.config import Config config = Config( retries={"total_max_attempts": 2, "mode": "standard"}, connect_timeout=5, read_timeout=10, ) # Same config for multiple clients s3 = boto3.client("s3", config=config) dynamodb = boto3.client("dynamodb", config=config) lambda_client = boto3.client("lambda", config=config) ``` You can also set a default client config in a botocore Session: ```python from botocore.config import Config from botocore.session import Session config = Config( retries={"total_max_attempts": 2, "mode": "standard"}, connect_timeout=5, read_timeout=10, ) session = Session() session.set_default_client_config(config) # Now all clients created will use this session-specific default # config if an explicit config is not provided. s3 = session.create_client('s3') dynamodb = session.create_client('dynamodb') ``` # Credentials Reference ## Default Credential Chain boto3 resolves credentials in this order: 1. Explicit `aws_access_key_id`/`aws_secret_access_key` passed to