aws-sdk-python-usage

Standardize boto3 and botocore usage in Python for AWS SDK operations.

Updated May 12, 2026
One-click install
npx skills add https://github.com/mreferre/aws-agent-toolkit-skills --skill aws-sdk-python-usage
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aws-sdk-python-usage
Source: https://github.com/mreferre/aws-agent-toolkit-skills/tree/main/.kiro/skills/aws-sdk-python-usage
Command: npx skills add https://github.com/mreferre/aws-agent-toolkit-skills --skill aws-sdk-python-usage

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents common boto3/botocore mistakes by standardizing how you create clients and sessions, make calls, handle errors, and work safely with pagination, waiters, and common services like S3 and DynamoDB.

Core Features & Use Cases

  • Client vs resource patterns: choose the correct interface (clients for API coverage, resources for higher-level object-oriented access).
  • Correct session, configuration, and credential handling: reuse clients properly, use botocore Config for retries/timeouts, and rely on boto3’s credential resolution.
  • Reliability utilities: use paginators instead of manual NextToken loops, use waiters for state transitions, and follow S3 transfer and presigned URL best practices.
  • DynamoDB correctness: prefer the resource interface for native Python types, use condition expressions safely, and handle typed exceptions correctly.
  • Error-handling discipline: catch only actionable exceptions and prefer service-specific typed exceptions over generic ClientError in business logic.

Quick Start

Use this skill when you are writing or reviewing Python code that imports boto3 or botocore for any AWS operation, including S3 transfers, presigned URLs, DynamoDB CRUD, or client configuration.

Frequently Asked Questions about aws-sdk-python-usage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle boto3 pagination without manual NextToken loops in Python?

To handle boto3 pagination correctly, use AWS SDK paginators instead of manual NextToken loops to automatically fetch all pages. Paginators provide a deterministic integration pattern for iterating through large result sets across AWS services safely and efficiently.

Should I use boto3 client or resource interface for DynamoDB operations in Python?

For DynamoDB operations, prefer the boto3 resource interface to automatically handle native Python type marshalling. Use the client interface when you need full API coverage or specific parameter control not exposed by the object-oriented resource model.

What is the best way to catch boto3 exceptions in Python without using generic ClientError?

The best way to catch boto3 exceptions is to use service-specific typed exceptions from botocore's exception hierarchy rather than generic ClientError. Catch only actionable exceptions in business logic to apply targeted error-handling discipline.

How do I configure boto3 retries and timeouts using botocore Config?

Configure boto3 retries and timeouts by passing a botocore Config object during client creation. Reuse configured clients properly across calls and rely on boto3's built-in credential resolution chain rather than hardcoding credentials for production readiness.

Can I use boto3 waiters to poll for AWS resource state transitions?

Yes, you can use boto3 waiters to poll for AWS resource state transitions deterministically. Waiters provide standardized reliability utilities that automatically handle polling logic and backoff until a resource reaches a target state, replacing manual polling loops.

Why does my boto3 S3 file transfer or presigned URL fail in production Python code?

S3 file transfers and presigned URLs fail when clients are not reused properly or parameter casing is incorrect. Follow S3 transfer best practices by using managed transfer methods and ensuring presigned URL generation adheres to AWS SDK idioms for production reliability.