sst.config.ts file in your project root. This file defines your app, its providers, and all resources.
Basic structure
A minimalsst.config.ts looks like this:
sst.config.ts
App configuration
Theapp function returns configuration for your application:
name
Type: string
The name of your app. This is used to prefix all resources.
home
Type: string
The default provider for your app. Can be aws, cloudflare, etc.
removal
Type: "remove" | "retain" | "retain-all"
The removal policy for resources:
remove- Resources are deleted when you runsst removeretain- Resources are kept when you runsst removeretain-all- All resources are kept
providers
Type: Record<string, string | ProviderConfig>
Define the providers your app uses:
Run function
Therun function is where you define your resources:
Environment variables
You can access environment variables in your config:Stage-specific configuration
Use theinput parameter to configure based on stage:
Watch configuration
Configure which files trigger a redeploy insst dev:
Related
- Components documentation - Learn about SST components
- Providers documentation - Learn about providers
sst install- Install providers