Basic Linking
Use thelink property to connect resources to functions:
sst.config.ts
src/lambda.ts
What Gets Linked
When you link a resource, SST exposes specific properties based on the resource type:Bucket
DynamoDB Table
API Gateway
Function
Queue
Secrets
Permissions
Linking automatically grants the necessary IAM permissions:Custom Permissions
You can customize permissions when linking:Type Safety
Linked resources provide full TypeScript support:Linking to Multiple Resources
You can link the same resources to multiple functions:Linking Secrets
Secrets are linked the same way:Linking to Other Components
Many components support linking:API Routes
Cron Jobs
Queues
App Metadata
Every function automatically has access to app metadata:Custom Linkable
You can make any resource linkable usingsst.Linkable.wrap:
Best Practices
Link What You Need
Only link resources that a function actually uses:Use Descriptive Names
Name your resources clearly:Organize by Domain
Group related resources:Related
Resource API
Access linked resources at runtime
Linking Concept
Deep dive into how linking works