SST Documentation

website·Indexed 36 days ago

https://sst.dev/docs

Documentation for SST, a framework for building apps with Infrastructure as Code (IaC). It features support for 150+ Pulumi and Terraform providers, AWS account setup and configuration, and a comprehensive set of commands for development and deployment. The docs cover core concepts like sst.config.ts, provider management via `sst add`, and detailed release notes for versions including 4.17.0.

Tokens
315K
Snippets
2.2K
Records
2.8K
Agent score
74%

What's inside SST

  1. Overview of sst.aws.Realtime component

    The sst.aws.Realtime component enables publishing and subscribing to messages in real-time using a topic-based messaging network powered by AWS IoT. It allows communication via WebSockets in the browser and on the server.

    Critical Constraint: AWS IoT is shared across all apps and stages within a single AWS account and region (there is only one IoT endpoint per region). To avoid collisions between different apps or stages, you must prefix your topics with the app name and stage name (e.g., ${Resource.App.name}/${Resource.App.stage}/topic-name).

  2. Overview of the SST Framework

    SST is a framework designed for building modern full-stack applications on your own infrastructure. Its primary differentiator is that the entire application—including databases, buckets, queues, and third-party integrations like Stripe webhooks—is defined in code within a single sst.config.ts file. SST supports over 150 different providers to automate infrastructure deployment.
  3. Overview of the SST Console

    The SST Console is an optional web-based dashboard located at console.sst.dev used to manage and monitor SST applications. It provides a centralized interface for teams to view apps, track resources and updates, view logs, receive alerts on issues, and perform deployments via git push. The Console includes a free tier.
  4. Overview of sst.aws.Router

    The sst.aws.Router component uses a CloudFront distribution to direct requests to different parts of an application. It leverages a CloudFront KeyValueStore to store routing data and a CloudFront function to dynamically set the origin based on the request. For frontends deployed across multiple regions, it automatically routes users to the closest region.
  5. Understand how SST Live mode works

    SST Live mode (initiated via sst dev) enables local development of remote Lambda functions by using AWS AppSync Events to proxy requests. When sst dev is run, SST bootstraps an AppSync Events API and replaces remote Lambda functions with 'stub' versions.

    Request flow:

    1. A remote Lambda is invoked, and the stub publishes an event containing the request payload.
    2. A local WebSocket client receives the event and acknowledges it.
    3. The local version of the function runs as a Node.js Worker and publishes the response payload.
    4. The stub Lambda receives the response and returns it to the original caller.
  6. Understand and use Cloud Providers in SST

    Providers in SST are packages installed via sst.config.ts that enable SST to interact with the APIs of various cloud services. Because SST is built on Pulumi and Terraform, it supports over 150 providers, including major cloud platforms (AWS, Azure, GCP) and third-party services such as Cloudflare, Stripe, Vercel, and Auth0.
  7. Interact with infrastructure using the SST SDK

    The SST SDK allows you to interact with your deployed infrastructure directly from your application runtime. You can access resource properties, such as the name of a DynamoDB table, via the Resource object provided by the SDK.
  8. Deploy a static website using sst.aws.StaticSite

    The sst.aws.StaticSite component deploys a static website to AWS by storing files in Amazon S3 and serving them via Amazon CloudFront. It can automatically run a build command for static site generators and upload the resulting output.
    // Minimal example: uploads the current directory
    new sst.aws.StaticSite("MyWeb");
  9. Understand SST bootstrap resources

    When deploying an app containing Lambda functions or Docker containers, SST automatically creates bootstrap resources in the same region as the resource. These include:

    • An assets bucket for function packages (typically named sst-asset-<hash>).
    • An ECR repository for container images named sst-asset.
    • An SSM parameter located at /sst/bootstrap which stores the names of the assets bucket and ECR repository.
    • An AppSync Events API endpoint used to power the Live feature.

    Note: When removing an SST app, state and bootstrap resources are not automatically deleted to avoid impacting other apps. These must be removed manually from the deployed regions to completely clean up the account.

  10. Understand how the SST Console works

    The SST Console is an open-source application built with SST that provides a management interface for your deployments. It is currently hosted by SST and stores metadata about your deployed resources. When you connect your AWS accounts, the Console deploys a separate CloudFormation stack to discover and automatically display all associated SST apps and stages.