AWS SDK Rules Quickstart
This is the orientation page for the enumerated rule references in this section.
Busca en todas las páginas de la documentación
This is the orientation page for the enumerated rule references in this section.
If you only have a few minutes, this page gives you the five highest-impact habits and points you at the checklist that goes deep on each one.
Read the Why AWS SDK Rules Exist explainer first for the reasoning; read this page for the map.
The five starter rules map one-to-one onto the failure modes from the previous page.
Here is the safe baseline: no keys in code, region pinned, client reused.
# --- Python (boto3) ---
import boto3
# Rule 1 + 5: no keys in code, one client created once and reused.
s3 = boto3.client("s3", region_name="us-east-1")// --- TypeScript (AWS SDK v3) ---
import { S3Client } from "@aws-sdk/client-s3";
// Rule 1 + 5: no keys in code, one client created once and reused.
const s3 = new S3Client({ region: "us-east-1" });If your code already does these five things, you have avoided the majority of real-world SDK incidents.
The rest of the section expands each starter rule into a full checklist. Read them in this order.
When you know the categories, the AWS SDK Rules & Best Practices Summary is the cross-cutting index you keep open during code review.
The checklists are written to be audited, not just read. Each rule is a checkbox you can hold your own code against.
A useful workflow is to open the relevant checklist next to a pull request and walk the boxes. Most reviews only need two or three categories - credentials and errors for a small feature, plus cost and cleanup for anything long-running or high-volume.
The rules are also portable across languages. Every checklist shows boto3 and AWS SDK for JavaScript v3 together, so a team that runs Python services and TypeScript Lambdas can apply one standard to both.
Do not treat the starter five as the finish line. They stop the common disasters, but the checklists carry the nuance: idempotency tokens for safe retries, adaptive retry mode for bursty load, partition-aware ARNs, and dependency scanning. Adopt the five today, then layer in the rest as your integration grows.
It is the orientation map for the SDK Rules section. It gives you five starter habits and points you to the checklist that covers each one in depth.
No hardcoded credentials, catch typed errors, bound your retries, batch and paginate instead of looping, and reuse and close clients.
The authentication and credential checklist. Leaked credentials are the highest-impact failure mode, so credential hygiene comes before everything else.
They prevent most real incidents, but they are a floor. The checklists add cost control, cleanup, least privilege, and safe-retry nuance you will want as code grows.
Yes. Every checklist shows Python and TypeScript side by side, so one standard covers services in both languages.
Open the relevant checklist next to the pull request and walk the boxes. Most changes only need two or three categories.
The Best Practices Summary at the end of the section links every checklist and condenses the categories into one review sheet.
Yes, because it is a cost rule. A loop of single calls can cost far more than one batched call, so batching belongs in the first five.
The credential and error rules still apply. A leaked key or an uncaught error in a script is just as costly as one in a service.
The SDK retries with backoff, but you still cap the attempts and only retry idempotent operations. Unbounded retries turn a transient error into a bill.
Stack versions: This page was written for boto3 1.43.x (Python 3.10+) and the AWS SDK for JavaScript v3 (Node.js 18+).
Revisado por Chris St. John·Última actualización: 23 jul 2026