Core AWS Services Best Practices
This is the checklist to run before and after standing up a new project on the ten core services.
Busca en todas las páginas de la documentación
This is the checklist to run before and after standing up a new project on the ten core services.
Each item is a rule stated positively, with a one-line rationale. Work top to bottom - the groups run in dependency order, from identity and network outward to cost.
SimulatePrincipalPolicy to confirm a role allows what you expect and nothing more.Let the default credential chain resolve a role rather than passing keys by hand.
# --- Python (boto3) ---
import boto3
# No keys in code: the SDK resolves the attached role's temporary credentials.
s3 = boto3.client("s3", region_name="us-east-1")// --- TypeScript (AWS SDK v3) ---
import { S3Client } from "@aws-sdk/client-s3";
// No keys in code: the provider chain resolves the attached role.
const s3 = new S3Client({ region: "us-east-1" });0.0.0.0/0 on sensitive ports.us-east-1, include it everywhere else.Query on one partition; prefer Query over Scan.boto3.resource / lib-dynamodb beat hand-writing typed attribute values.ManageMasterUserPassword (Secrets Manager) or IAM database authentication.instance_running, function_active_v2, and friends rather than hand-rolled sleep loops.WaitTimeSeconds to cut empty receives, lower cost, and reduce latency.ChangeMessageVisibility so messages are not reprocessed early.RequestId / $metadata.requestId so AWS support can trace calls.With identity and network. Set up least-privilege roles and a VPC with private subnets first, because almost everything else depends on them being right.
Roles hand your code rotating temporary credentials with no stored secret to leak. Access keys are long-lived, hard to rotate, and a common breach source, so reserve them for cases with no role path.
Tight polling and unbounded loops. They turn one logical action into thousands of billed requests. Use waiters, long polling, batching, and event-driven patterns instead.
Delete a message only after it is fully processed, size the visibility timeout above your processing time, and make the work idempotent. Use a FIFO queue if you need exactly-once.
An internet-facing database is a large attack surface. Placing RDS and ElastiCache in private subnets, reachable only from your application's security group, drastically reduces exposure.
Raw counts scale with traffic and cause noisy, flapping alarms. A rate or percentage stays meaningful across traffic levels, so the alarm fires on real problems, not on growth.
Start from your access patterns, not your entities. Choose keys so your most frequent reads become single-partition Query calls, and add indexes for secondary patterns. Avoid Scan on hot paths.
Reverse of creation. For networking, delete security groups and subnets before the VPC. For IAM, detach policies before deleting them and the role. Dependencies must go first.
AMI IDs are region-specific and are republished over time. Reading the latest ID from an SSM public parameter keeps launches working across regions and as images update.
Mostly yes. Least privilege, private networking, tagging, dead-letter queues, and rate-based alarms are architectural habits that apply whether you provision from the SDK or from CloudFormation, CDK, or Terraform.
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