Skip to content
Blog

Container support

JayNovember 8, 2024

Historically, SST has primarily supported deploying serverless applications. But over the last month we’ve slowly expanded native support for containers on AWS.

This includes changes across the entire SST platform.


1. Components

There’s a new family of components that’ll help you build with containers.

  • Cluster & Service

    These help you deploy your containerized applications to AWS using ECS and Fargate.

    sst.config.ts
    const cluster = new sst.aws.Cluster("MyCluster", { vpc });
    cluster.addService("MyService", {
    loadBalancer: {
    ports: [{ listen: "80/http", forward: "3000/http" }],
    },
    dev: {
    command: "npm run dev",
    },
    });

    In addition to configuring ECS and Fargate, this also configures service discovery for your applications.

  • Vpc

    Container applications are usually deployed in a VPC. So this component makes it easy to create a VPC. And optionally add a bastion host or a NAT gateway.

    sst.config.ts
    new sst.aws.Vpc("MyVpc", { bastion: true, nat: "managed" });
  • Postgres, Redis, & Efs

    While these components are not specifically for containers, they’ve been designed to work well with the above Cluster and Vpc components.


Cost

Unlike our serverless components, that are pay-per-use, these components have a more traditional pricing structure. We’ve taken special care to ensure that these components are as cost effective as possible to get started with. While still allowing you to scale with them.

Unfortunately, AWS’ pricing pages for these services is not great. So the above components have a new Cost section in their docs. For example, here’s what the cost of using the Vpc component looks like.

You can read more about what we’ve done here.


2. CLI

There are two big things we’ve done with our CLI to support containers.

  1. The dev prop allows you to run your application locally in a new tab in the sst dev multiplexer.

  2. The new sst tunnel command allows your local machine to connect to resources that’ve been deployed in a VPC. This is helpful because most of the container related components need a VPC. You can check it out in action here.


3. Console

The SST Console now shows you logs for your containers. And Autodeploy will support running in the same VPC as your app. This will allow your deploy process to have access to all the resources in your app.


Get started

We’ve updated all our tutorials to help you get started with the new containers.

The frontends now support deploying to both serverless and containers.


What’s next

Over the next few weeks we’ll extend support to other languages and frameworks. Like Rails, Laravel, Python, Elixir, Go, and more.