What is SST?
SST (Serverless Stack) is a framework for building full-stack applications on AWS. Version 3 is a complete rewrite using Pulumi under the hood, with a dramatically simpler API.
SST v3 lets you define your entire AWS infrastructure in TypeScript — and deploy it with a single command.
Quick Start
npx sst@latest init
npx sst dev
This gives you a live development environment with real AWS resources — not emulators.
Define Infrastructure
// sst.config.ts
export default $config({
app(input) {
return {
name: "my-app",
home: "aws",
};
},
async run() {
// Create an API
const api = new sst.aws.ApiGatewayV2("MyApi");
api.route("GET /", "packages/functions/src/hello.handler");
api.route("GET /users", "packages/functions/src/users.list");
api.route("POST /users", "packages/functions/src/users.create");
// Create a database
const db = new sst.aws.Dynamo("MyTable", {
fields: { pk: "string", sk: "string" },
primaryIndex: { hashKey: "pk", rangeKey: "sk" },
});
// Create a bucket
const bucket = new sst.aws.Bucket("MyBucket");
// Link resources to functions
api.route("POST /upload", {
handler: "packages/functions/src/upload.handler",
link: [bucket, db],
});
// Create a frontend
new sst.aws.Nextjs("MyFrontend", {
link: [api],
});
},
});
Use Linked Resources
// packages/functions/src/upload.ts
import { Resource } from "sst";
import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";
const s3 = new S3Client({});
export const handler = async (event) => {
// Resource.MyBucket is auto-typed!
await s3.send(new PutObjectCommand({
Bucket: Resource.MyBucket.name,
Key: "file.txt",
Body: "Hello World",
}));
return { statusCode: 200, body: "Uploaded!" };
};
Type-safe resource linking — Resource.MyBucket.name is validated at compile time.
Key Components
// Cron job
new sst.aws.Cron("MyCron", {
schedule: "rate(1 hour)",
job: "packages/functions/src/cron.handler",
});
// Queue
const queue = new sst.aws.Queue("MyQueue");
queue.subscribe("packages/functions/src/queue.handler");
// Email
new sst.aws.Email("MyEmail", {
sender: "noreply@myapp.com",
});
// Auth
const auth = new sst.aws.Auth("MyAuth", {
authenticator: "packages/functions/src/auth.handler",
});
// Static site
new sst.aws.StaticSite("MySite", {
path: "packages/web",
build: { output: "dist", command: "npm run build" },
domain: "myapp.com",
});
Live Lambda Development
npx sst dev
This connects your local machine to real AWS — changes to Lambda functions are reflected instantly (no deploy needed). Set breakpoints, see logs in real-time.
Deploy
# Deploy to production
npx sst deploy --stage production
# Remove all resources
npx sst remove
Why SST v3?
| Feature | SST v3 | Serverless Framework | CDK |
|---|---|---|---|
| Language | TypeScript | YAML | TypeScript |
| Live Dev | Real AWS | Emulator | None |
| Resource Linking | Type-safe | Manual | Manual |
| Frontend Support | Built-in | None | None |
| Deploy Speed | ~30s | 2-5 min | 2-5 min |
Building on AWS? I help teams with serverless architecture and automation.
📧 spinov001@gmail.com
🔧 My tools on Apify Store
What's your serverless stack? Share below!
Top comments (0)