/aws:sstfrom aws
Build and deploy full-stack applications on AWS using SST v3 (Ion). Use whenever the user mentions SST, Serverless Stack, sst.config.ts, sst dev, sst deploy, or builds serverless TypeScript apps on AWS. Also trigger on imports like `import { Resource } from 'sst'`, `sst.aws.*` components, or Lambda + API Gateway + DynamoDB + S3 patterns. Covers component selection, resource linking, secrets, deployment stages, CI/CD, cost optimization, and troubleshooting.
Ships in aws. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
SST v3 uses Pulumi/Terraform (not CDK/CloudFormation like v2), deploys from your local machine, and stores state in S3. Your entire app is defined in a single sst.config.ts.
Before writing infrastructure code, answer these questions — they drive every component and configuration decision:
| Question | Impact |
|---|---|
| Traffic pattern: Bursty or steady? Peak RPS? | Bursty → Lambda. Steady/high-throughput → ECS Service |
| Latency budget: Can you tolerate cold starts? | <100ms p99 → warm Service or provisioned Lambda. <1s OK → Lambda |
| Data model: Relational or access-pattern-driven? | Complex joins → Postgres (Aurora). Known access patterns → DynamoDB |
| Execution time: Under 15 minutes? | Yes → Lambda. No → Task (one-off) or Service (persistent) |
| Persistent connections: WebSockets, streaming, connection pools? | Yes → Service (Fargate) or Realtime. Lambda can't hold connections |
| Cost ceiling: Monthly budget? | <$10/mo → Lambda + DynamoDB (pure serverless). $50+ → can afford VPC/Postgres |
| Team stages: Devs need isolated environments? | Yes → SST stages. Each sst dev creates personal infra per developer |
Use the answers to route into the decision tree below.
| Scenario | Framework Fit | Primary Components |
|---|---|---|
| REST/GraphQL API | Bursty, <15min, access-pattern data | ApiGatewayV2 + Function + Dynamo/Postgres |
| Full-stack Next.js/Remix/Astro | Frontend + API, SSR needed | Nextjs/Remix/Astro + ApiGatewayV2 |
| Static site + API | No SSR, bursty API | StaticSite + ApiGatewayV2 + Function |
| Event-driven microservices | Async, decoupled producers/consumers | Bus + Queue + SnsTopic + Function |
| Containers (long-running) | Steady traffic, persistent connections, >15min | Cluster + Service |
| Background jobs / Cron | Scheduled or one-off compute | Cron + Function or Task (>15min) |
| Real-time (WebSocket) | Persistent connections, pub/sub | Realtime or ApiGatewayWebSocket |
| AI/ML streaming | Response streaming, long inference | Function (streaming) or Service (GPU) |
Read components.md before selecting or configuring components. Do not load patterns.md, deployment.md, or troubleshooting.md for component selection.
Read patterns.md when designing multi-service architecture or choosing between patterns. Do not load deployment.md or troubleshooting.md for architecture design.
Never use .env files for resource credentials — SST's linking system (link: [resource] + Resource.X.name) is type-safe, auto-rotates credentials, and manages IAM permissions automatically. .env files are insecure, stage-unaware, and cause credential drift across team members.
Never forget /// <reference path="./.sst/platform/config.d.ts" /> at the top of sst.config.ts — without it, TypeScript won't know about $config, sst.aws.*, or $app. Run sst install to generate them if they're missing; it does not deploy. If the file is still missing afterwards, the user starts sst dev once on their personal stage; the agent does not, because it deploys.
Never set removal: "remove" in production — this deletes all resources (including databases with your data) when you run sst remove. Production must use "retain": removal: input?.stage === "production" ? "retain" : "remove".
Never import resources managed by another IaC tool — SST takes full ownership of imported resources. Removing the import from code deletes the actual resource. If another team manages it, reference it via Linkable instead.
Never put secrets in sst.config.ts directly — they end up in state files and git. Use new sst.Secret("MySecret") + sst secret set MySecret value. Secrets are encrypted in S3.
Never manually create IAM roles for linked resources — when you link: [bucket] on a function, SST automatically grants the correct IAM permissions. Adding manual policies causes conflicts and over-permissioning.
Never skip the --fallback flag for secrets in preview/PR environments — PR-based preview stages don't have secrets set. sst secret set MySecret fallback-value --fallback provides a default for all stages without explicit secrets.
Never use process.env to access linked resources in functions — linked resources are injected encrypted into globalThis (not env vars) and decrypted by the SST SDK. Use import { Resource } from "sst" and Resource.MyBucket.name.
Never deploy containers without setting health.path — ECS services will repeatedly restart without proper health checks. Use a lightweight /health endpoint returning 200, not your main handler.
Never use VPC for Lambda unless you actually need private resource access — VPC adds cold start latency (seconds, not ms) and requires NAT Gateway ($32+/month) for internet access. Most Lambda functions don't need VPC. DynamoDB, S3, SQS, SNS, EventBridge are all accessible without VPC.
Deploy and remove only on the personal stage — the agent runs sst deploy and sst remove only on the personal stage. --stage production or any other shared stage needs the user's explicit ask in this conversation. To inspect, use sst diff and read sst.config.ts; discovery never deploys.
Never run sst dev on shared or production stages — sst dev replaces Lambda functions with stub proxies. If you kill the CLI, the stubs remain deployed and all invocations will timeout. Run sst deploy to restore real functions. Personal stages only.
Never expect automatic rollback on failed deploys — unlike CloudFormation, SST v3 has NO rollback. A failed deploy leaves infrastructure partially updated. Always test in a dev stage first. Use sst diff to preview changes before deploying.
Never forget protect: true for production — this prevents sst remove from executing at all on the stage, as a safety net beyond removal: "retain".
Never delete the SSM parameter at /sst/passphrase/<app>/<stage> — without it, SST cannot decrypt your state file or deploy your app. This is the encryption key for all secrets in state.
Never use managed NAT Gateway in dev/staging stages — use nat: "ec2" (t4g.nano ~$4/month) instead of nat: "managed" ($32/month per AZ). Reserve managed NAT for production where you need HA.
Never name resources with lowercase or special characters — SST component names must be PascalCase alphanumeric (e.g., "MyBucket" not "my-bucket"). SST auto-generates actual AWS resource names from this.
Never deploy to production without $transform for global standards — use global transforms to enforce ARM architecture, log retention, tagging, and permissions boundaries across all functions.
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: "my-app",
removal: input?.stage === "production" ? "retain" : "remove",
protect: ["production"].includes(input?.stage),
home: "aws",
providers: { aws: { region: "us-east-1" } },
};
},
async run() {
// Global standards — enforce on ALL functions
$transform(sst.aws.Function, (args) => {
args.architecture ??= "arm64";
args.logging ??= { retention: "1 week" };
});
// Split infra into files
await import("./infra/storage");
await import("./infra/api");
// Return outputs: return { apiUrl: api.url }
},
});
Key facts: run() is async. $app.stage gives current stage. $dev is true during sst dev. ??= in transforms lets individual functions override defaults.
Linking replaces hardcoded env vars with type-safe, IAM-managed resource access.
// infra: link resources to functions
const bucket = new sst.aws.Bucket("Uploads");
api.route("POST /upload", {
handler: "packages/functions/src/upload.handler",
link: [bucket], // grants IAM permissions + injects reference
});
// function code: access via Resource
import { Resource } from "sst";
Resource.Uploads.name; // type-safe, auto-completed bucket name
What linking handles for you: IAM permissions (read/write to the linked resource), type-safe access (Resource.X), encrypted injection in Lambda (not env vars), and SST_RESOURCE_* env vars for frontends (server-side only).
Also works with: Secrets (Resource.MySecret.value), custom linkables (new sst.Linkable("Config", { properties: { ... } })), external Pulumi resources (Linkable.wrap()), and all frontend frameworks.
const stripeKey = new sst.Secret("StripeKey");
// Link to function: link: [stripeKey]
// Access in code: Resource.StripeKey.value
sst secret set StripeKey sk_live_xxx --stage production # per-stage
sst secret set StripeKey sk_test_xxx --fallback # fallback for PR/preview stages
Placeholder pattern for non-sensitive defaults: new sst.Secret("SentryDsn", "https://[email protected]/123") — can be overridden per stage but has a usable default out of the box.
SST recommends a monorepo: sst.config.ts at root, infra/ for infrastructure split by domain (api.ts, storage.ts, auth.ts), packages/functions/ for Lambda handlers, packages/core/ for shared business logic, packages/web/ for frontend.
Why split infra/ into files? Keeps config readable and imports clean: await import("./infra/storage") in run(). Organize by domain (orders, users, auth), not by AWS service.
sst dev creates a personal stage per developer. sst deploy --stage X deploys named stages. sst remove --stage X tears down everything.
Stage-conditional pattern:
const isProd = $app.stage === "production";
const api = new sst.aws.ApiGatewayV2("Api", {
domain: isProd ? { name: "api.example.com" } : undefined,
});
Read deployment.md when setting up CI/CD, GitHub Actions, SST Console auto-deploy, custom domains, or preview environments. Do not load components.md or patterns.md for deployment setup.
// Global: enforce ARM + log retention on ALL functions
$transform(sst.aws.Function, (args) => {
args.architecture = "arm64"; // Graviton — 20% cheaper, faster
args.logRetention = "1 week"; // prevent unbounded CloudWatch costs
});
// Per-component: customize underlying AWS resources
new sst.aws.Function("MyFunc", {
handler: "src/handler.main",
transform: {
function: (args) => { args.ephemeralStorage = { size: 1024 }; },
role: (args) => { args.maxSessionDuration = 7200; },
},
});
Production checklist for $transform:
arm64) — 20% cost savings, faster cold startsAdd opts.import in the component's transform → deploy → read the error message → set matching args → deploy again → remove opts.import (keep args).
new sst.aws.Bucket("MyBucket", {
transform: {
bucket: (args, opts) => { opts.import = "my-existing-bucket-name"; },
},
});
Warning: Once imported, SST owns it. Removing from code deletes the real resource. To reference without owning, use Linkable instead.
| Resource | Hidden Cost | Mitigation |
|---|---|---|
| NAT Gateway | $32+/month per AZ | Avoid VPC for Lambda; use nat: "ec2" ($4/mo) in dev |
| CloudWatch Logs | Unbounded | Set logRetention: "1 week" via $transform |
| API Gateway | $1/million requests | Watch for runaway polling from frontends |
| DynamoDB On-Demand | $1.25/million writes | Use provisioned for predictable workloads |
| RDS Aurora Serverless | $0.06/ACU-hour min | Cold start takes 25+ seconds; min ~$43/month |
| Secrets Manager | $0.40/secret/month | SST uses S3-encrypted secrets instead (free) |
Biggest trap: VPC with NAT Gateways for Lambda functions that don't need private access. Three AZs with managed NAT = $96/month idle.
Deployment fails?
aws sts get-caller-identity — fix credentialssst remove --stage X to clean up orphaned resources$output() to break cyclesFunction not working in sst dev?
link: [resource] on the function.sst/ and run sst install to regenerate types (no deploy)Frontend can't access API?
cors: true to ApiGatewayV2 and return CORS headers from Lambdaenvironment prop (not link), with NEXT_PUBLIC_/VITE_ prefix for client-siderun() and pass via environment: { NEXT_PUBLIC_API: api.url }Read troubleshooting.md for detailed error resolution, state recovery, or migration from v2/Serverless Framework/CDK. Do not load other references when debugging.
What SKILL.md sets; muted values are Claude Code's defaults
6 skills in this plugin
/agui-strandsBuild or debug generative-UI chat apps on the AG-UI × Strands × Bedrock AgentCore × Vercel AI SDK (useChat) stack. Use WHEN: scaffolding an ag_ui_strands agent server (StrandsAgent, @tool, BedrockModel, EventEncoder, RunAgentInput, /invocations, /ping, 0.0.0.0:8080, arm64); writing the createUIMessageStream bridge (RUN_STARTED→start-step, TOOL_CALL_RESULT→tool-output-available, start/finish envelope, SSE buffer flush); building generative-UI card renderers (useChat, dynamic-tool parts, tool-input-available, tool-output-available, AI SDK v5/v6); deploying to Bedrock AgentCore Runtime (InvokeAgentRuntime, runtimeSessionId, ECR, OpenNext streaming, Terraform); or debugging: blank chat bubble, tool chip spins forever, text part not found, agent forgets context after message 1, frozen pane, runtimeSessionId length errors, manifest-list/image-not-found on deploy./aws-exploreToken-efficient AWS resource exploration during debugging. Use when: (1) debugging live AWS resources — S3 access issues, DynamoDB query patterns, Bedrock/AgentCore failures, (2) the user asks what's in their AWS account, (3) you need to understand the shape/config of AWS resources before making changes. Covers S3, DynamoDB, and Bedrock/AgentCore. Do NOT use for: creating/modifying AWS resources (use sst skill), deploying agents (use strands-agentcore skill), or general AWS documentation questions. Trigger keywords: s3, bucket, dynamodb, table, bedrock, agentcore, aws, 403, access denied, describe, explore, scan.Other plugins' skills for the same job
npx claudepluginhub tomaspalsson/flow --plugin aws