Skip to main content
SST components are high-level building blocks that help you deploy your applications to AWS and other cloud providers. They handle the underlying infrastructure complexity while exposing simple, type-safe interfaces.

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:

Using Components

Basic Usage

Create components in your sst.config.ts:
sst.config.ts
export default $config({
  async run() {
    const bucket = new sst.aws.Bucket("MyBucket");
    const api = new sst.aws.Function("MyApi", {
      handler: "src/api.handler",
      link: [bucket]
    });
  }
});

Linking Resources

Components can be linked together to grant permissions and share configuration:
const bucket = new sst.aws.Bucket("MyBucket");
const api = new sst.aws.Function("MyFunction", {
  handler: "src/api.handler",
  link: [bucket]
});
Access linked resources in your code:
src/api.ts
import { Resource } from "sst";

// Type-safe access to bucket name
console.log(Resource.MyBucket.name);

Transform Resources

Customize the underlying cloud resources:
new sst.aws.Bucket("MyBucket", {
  transform: {
    bucket: {
      serverSideEncryptionConfiguration: {
        rule: {
          applyServerSideEncryptionByDefault: {
            sseAlgorithm: "AES256"
          }
        }
      }
    }
  }
});

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

Build docs developers (and LLMs) love