DEV Community

Alex Spinov
Alex Spinov

Posted on

SST Has a Free API: Deploy Full-Stack Apps to AWS Without CloudFormation Pain

CloudFormation is XML-pretending-to-be-YAML. CDK is better but verbose. SST lets you define AWS infrastructure in TypeScript that actually makes sense.

What Is SST?

SST (Serverless Stack) is a framework for building full-stack apps on AWS. It uses Pulumi under the hood but wraps it in components that handle the AWS complexity.

// sst.config.ts
export default $config({
  app(input) {
    return { name: "my-app", home: "aws" }
  },
  async run() {
    // Create an API
    const api = new sst.aws.ApiGatewayV2("MyApi")
    api.route("GET /", "src/api.handler")
    api.route("POST /users", "src/users.create")

    // Create a bucket
    const bucket = new sst.aws.Bucket("Uploads")

    // Create a Next.js site
    const site = new sst.aws.Nextjs("MySite", {
      link: [api, bucket],
    })

    return { url: site.url, api: api.url }
  },
})
Enter fullscreen mode Exit fullscreen mode
npx sst dev   # Live Lambda development (hot reload!)
npx sst deploy --stage prod  # Deploy to production
Enter fullscreen mode Exit fullscreen mode

Live Lambda Development

SST's killer feature: live development. Your Lambda functions run locally but are connected to real AWS services:

npx sst dev
# Your function runs on YOUR machine
# But uses real DynamoDB, S3, SQS on AWS
# Changes reflect instantly — no deploy needed
Enter fullscreen mode Exit fullscreen mode

Components

// Database
const db = new sst.aws.Dynamo("MyTable", {
  fields: { userId: "string", createdAt: "number" },
  primaryIndex: { hashKey: "userId", rangeKey: "createdAt" },
})

// Queue + consumer
const queue = new sst.aws.Queue("MyQueue")
queue.subscribe("src/consumer.handler")

// Cron job
new sst.aws.Cron("DailyReport", {
  schedule: "rate(1 day)",
  job: "src/report.handler",
})

// Auth
const auth = new sst.aws.Auth("MyAuth", {
  authenticator: "src/auth.handler",
})

// Link resources to functions
api.route("GET /users", {
  handler: "src/users.list",
  link: [db, bucket],
})
Enter fullscreen mode Exit fullscreen mode

Resource Linking

// In your Lambda function
import { Resource } from "sst"

export async function handler() {
  // Type-safe access to linked resources
  const tableName = Resource.MyTable.name
  const bucketName = Resource.Uploads.name
  // No environment variable juggling!
}
Enter fullscreen mode Exit fullscreen mode

Why SST

  • Live development — instant feedback, no redeploys
  • TypeScript everywhere — infrastructure AND application code
  • Resource linking — type-safe references between resources
  • Multi-framework — Next.js, Remix, Astro, SvelteKit, Solid
  • Drop-in components — not a new abstraction, uses real AWS services

Building on AWS? Check out my developer tools or email spinov001@gmail.com.

Top comments (0)