What are Components?
Components are TypeScript/JavaScript classes that create and configure cloud resources. Each component:- Creates infrastructure - Provisions and configures cloud resources
- Manages state - Tracks resource state through Pulumi
- Provides linking - Connect resources together with type-safe references
- Handles deployment - Deploys your code and infrastructure together
Available Components
AWS Components
Deploy serverless applications and infrastructure on AWS:- Function - Deploy Lambda functions
- Bucket - Create S3 buckets for storage
- Queue - Add SQS queues for messaging
- Dynamo - Create DynamoDB tables
- ApiGatewayV2 - Create HTTP APIs
- Nextjs - Deploy Next.js applications
- Remix - Deploy Remix applications
- Astro - Deploy Astro sites
- Cluster - Deploy containerized services
- Service - Deploy ECS services
- Vpc - Create virtual private clouds
- Postgres - Create RDS Postgres databases
- Aurora - Create Aurora Serverless clusters
- Auth - Add authentication with Cognito
- Realtime - Add WebSocket support
- Router - Create CloudFront distributions
Cloudflare Components
Deploy to Cloudflare’s edge network:- Worker - Deploy Cloudflare Workers
- Bucket - Use R2 object storage
- Kv - Use Workers KV
- D1 - Use D1 SQL database
- Queue - Use Cloudflare Queues
Vercel
Deploy to Vercel:- Vercel - Deploy to Vercel
Using Components
Basic Usage
Create components in yoursst.config.ts:
sst.config.ts
Linking Resources
Components can be linked together to grant permissions and share configuration:src/api.ts
Transform Resources
Customize the underlying cloud resources:Component Properties
Most components expose:- Constructor args - Configure the component
- Properties - Access resource attributes (
.arn,.name, etc.) - Nodes - Access underlying cloud resources
- Methods - Perform actions (
.subscribe(),.route(), etc.)
Learn More
- Linking Resources - Connect components together
- Live Development - Develop with
sst dev - Transforming Resources - Customize infrastructure