www/src/content/docs/docs/console.mdx
import { Image } from "astro:assets" import { Tabs, TabItem } from '@astrojs/starlight/components';
import consoleHomeLight from '../../../assets/docs/console/sst-console-home-light.png'; import consoleHomeDark from '../../../assets/docs/console/sst-console-home-dark.png'; import consoleLogsLight from '../../../assets/docs/console/sst-console-logs-light.png'; import consoleLogsDark from '../../../assets/docs/console/sst-console-logs-dark.png'; import consoleIssuesLight from '../../../assets/docs/console/sst-console-issues-light.png'; import consoleIssuesDark from '../../../assets/docs/console/sst-console-issues-dark.png'; import consoleLocalLight from '../../../assets/docs/console/sst-console-local-light.png'; import consoleLocalDark from '../../../assets/docs/console/sst-console-local-dark.png'; import consoleResourcesLight from '../../../assets/docs/console/sst-console-resources-light.png'; import consoleResourcesDark from '../../../assets/docs/console/sst-console-resources-dark.png'; import consoleUpdatesLight from '../../../assets/docs/console/sst-console-updates-light.png'; import consoleUpdatesDark from '../../../assets/docs/console/sst-console-updates-dark.png'; import consoleAutodeployLight from '../../../assets/docs/console/sst-console-autodeploy-light.png'; import consoleAutodeployDark from '../../../assets/docs/console/sst-console-autodeploy-dark.png';
The Console is a web based dashboard to manage your SST apps — console.sst.dev
With it, you and your team can see all your apps, their resources and updates, view logs, get alerts on any issues, and git push to deploy them.
<a href="https://console.sst.dev" target="_blank" rel="noopener noreferrer"> <picture> <source srcset={consoleHomeDark.src} media="(prefers-color-scheme: dark)" /> <source srcset={consoleHomeLight.src} media="(prefers-color-scheme: light)" /> <Image src={consoleHomeLight} alt="SST Console" /> </picture> </a>:::tip The Console is completely optional and comes with a free tier. :::
Start by creating an account and connecting your AWS account.
:::note Currently the Console only supports apps deployed to AWS. :::
Create an account with your email
It's better to use your work email so that you can invite your team to your workspace later — console.sst.dev
Create a workspace
You can add your apps and invite your team to a workspace. A workspace can be for a personal project or for your team at work. You can create as many workspaces as you want.
:::tip Create a workspace for your organization. You can use it to invite your team and connect all your AWS accounts. :::
Connect your AWS account
This will ask you to create a CloudFormation stack in your AWS account. Make sure that this stack is being added to us-east-1. Scroll down and click Create stack.
:::caution The CloudFormation stack needs to be created in us-east-1. If you create it in the wrong region by mistake, remove it and create it again. :::
This stack will scan all the regions in your account for SST apps and subscribe to them. Once created, you'll see all your apps, stages, and the functions in the apps.
If you are connecting a newly created AWS account, you might run into the following error while creating the stack.
Resource handler returned message: "Specified ReservedConcurrentExecutions for function decreases account's UnreservedConcurrentExecution below its minimum value
This happens because AWS has been limiting the concurrency of Lambda functions for new accounts. It's a good idea to increase this limit before you go to production anyway.
To do so, you can request a quota increase to the default value of 1000. You can also do the following to expedite the request.
<details> <summary>Expedite the request</summary> If you want to expedite the request:Invite your team
Use the email address of your teammates to invite them. They just need to login with the email you've used and they'll be able to join your workspace.
At a high level, here's how the Console works.
It's hosted on our side
It stores some metadata about what resources you have deployed. We'll have a version that can be self-hosted in the future.
You can view all your apps and stages
Once you've connected your AWS accounts, it'll deploy a separate CloudFormation stack and connect to any SST apps in it. And all your apps and stages will show up automatically.
It's open-source and built with SST
The Console is an SST app. You can view the source on GitHub. It's also auto-deployed using itself.
The CloudFormation stack that the Console uses, creates an IAM Role in your account to manage your resources. If this is a concern for your production environments, we have a couple of options.
By default, this role is granted AdministratorAccess, but you can customize it to restrict access. We'll look at this below. Additionally, if you'd like us to sign a BAA, feel free to contact us.
There maybe cases where you don't want any data leaving your AWS account. For this, we'll be supporting self-hosting the Console in the future.
Permissions for the Console fall into two categories: read and write:
Read Permissions: The Console needs specific permissions to display information about resources within your SST apps.
| Purpose | AWS IAM Action |
|---|---|
| Fetch stack outputs | cloudformation:DescribeStacks |
| Retrieve function runtime and size | lambda:GetFunction |
| Access stack metadata | ec2:DescribeRegions |
s3:GetObject
s3:ListBucket|
| Display function logs | logs:DescribeLogStreams
logs:FilterLogEvents
logs:GetLogEvents
logs:StartQuery|
| Monitor invocation usage | cloudwatch:GetMetricData |
Attach the arn:aws:iam::aws:policy/ReadOnlyAccess AWS managed policy to the IAM Role for comprehensive read access.
Write Permissions: The Console requires the following write permissions.
| Purpose | AWS IAM Action |
|---|---|
| Forward bootstrap bucket events to event bus | s3:PutBucketNotification |
| Send events to Console | events:PutRule |
events:PutTargets |
| Grant event bus access for Console | iam:CreateRole
iam:DeleteRole
iam:DeleteRolePolicy
iam:PassRole
iam:PutRolePolicy |
| Enable Issues to subscribe logs | logs:CreateLogGroup
logs:PutSubscriptionFilter |
| Invoke Lambda functions and replay invocations | lambda:InvokeFunction |
It's good practice to periodically review and update these policies.
To customize IAM permissions for the CloudFormation stack:
On the CloudFormation create stack page, download the default template.json.
Edit the template file with necessary changes.
<details> <summary>_View the template changes_</summary> "SSTRole": {
"Type": "AWS::IAM::Role",
"Properties": {
...
"ManagedPolicyArns": [
- "arn:aws:iam::aws:policy/AdministratorAccess"
+ "arn:aws:iam::aws:policy/ReadOnlyAccess"
+ ],
+ "Policies": [
+ {
+ "PolicyName": "SSTPolicy",
+ "PolicyDocument": {
+ "Version": "2012-10-17",
+ "Statement": [
+ {
+ "Effect": "Allow",
+ "Action": [
+ "s3:PutBucketNotification"
+ ],
+ "Resource": [
+ "arn:aws:s3:::sstbootstrap-*"
+ ]
+ },
+ {
+ "Effect": "Allow",
+ "Action": [
+ "events:PutRule",
+ "events:PutTargets"
+ ],
+ "Resource": {
+ "Fn::Sub": "arn:aws:events:*:${AWS::AccountId}:rule/SSTConsole*"
+ }
+ },
+ {
+ "Effect": "Allow",
+ "Action": [
+ "iam:CreateRole",
+ "iam:DeleteRole",
+ "iam:DeleteRolePolicy",
+ "iam:PassRole",
+ "iam:PutRolePolicy"
+ ],
+ "Resource": {
+ "Fn::Sub": "arn:aws:iam::${AWS::AccountId}:role/SSTConsolePublisher*"
+ }
+ },
+ {
+ "Effect": "Allow",
+ "Action": [
+ "logs:CreateLogGroup",
+ "logs:PutSubscriptionFilter"
+ ],
+ "Resource": {
+ "Fn::Sub": "arn:aws:logs:*:${AWS::AccountId}:log-group:*"
+ }
+ },
+ {
+ "Effect": "Allow",
+ "Action": [
+ "lambda:InvokeFunction"
+ ],
+ "Resource": {
+ "Fn::Sub": "arn:aws:lambda:*:${AWS::AccountId}:function:*"
+ }
+ }
+ ]
+ }
+ }
]
}
}
Upload your edited template.json file to an S3 bucket.
Return to the CloudFormation create stack page and replace the template URL in the page URL.
Starting Feb 1, 2025, the Console will be priced based on the number of active resources in your SST apps.
| Resources | Rate per resource |
|---|---|
| First 2000 | $0.086 |
| 2000+ | $0.032 |
Free Tier: Workspaces with 350 active resources or fewer.
So for example, if you go over the free tier and have 351 active resources in a month, your bill will be 351 x $0.086 = $30.2.
A couple of things to note.
A resource is considered active if it comes from a stage that has been around for at least 2 weeks. And, was updated during the month.
Let's look at a few different scenarios to see how this works.
Previously, the Console pricing was based on the number of times the Lambda functions in your SST apps are invoked per month and it used the following tiers.
| Invocations | Rate (per invocation) |
|---|---|
| First 1M | Free |
| 1M - 10M | $0.00002 |
| 10M+ | $0.000002 |
Here are a few of the things the Console does for you.
sst dev sessionWith the Console, you don't need to go to CloudWatch to look at the logs for your functions, containers and other log groups. You can view:
The Console will automatically show you any errors in your Node.js Lambda functions and containers in real-time. And notify you through Slack or email.
<picture> <source srcset={consoleIssuesDark.src} media="(prefers-color-scheme: dark)" /> <source srcset={consoleIssuesLight.src} media="(prefers-color-scheme: light)" /> <Image src={consoleIssuesLight} alt="SST Console Issues" /> </picture>With Issues, there is:
:::note Issues works out of the box and has no impact on performance. :::
Issues currently only supports Node.js functions and containers. Other languages and runtimes are on the roadmap.
For the Console to automatically report your errors, you need to console.error an error object.
console.error(new Error("my-error"));
This works a little differently for containers and functions.
Containers
In a container applications, your code needs to also import the SST JS SDK.
import "sst";
console.error(new Error("my-error"));
This applies a polyfill to the console object to prepend the log lines with a marker that allows Issues to detect errors. More on this below.
If you are already importing the SDK, you won't need to add an additional import.
Functions
In addition, to errors logged using console.error(new Error("my-error")), Issues also reports Lambda function failures.
console.error(new Error("my-error"));
In Lambda you don't need to import the SDK to polyfill the console object. Since the Lambda runtime does this automatically for you.
Here's how Issues works behind the scenes.
console object to add the marker.The log subscriber also includes the following:
These are added to every region in your AWS account that has a CloudWatch log group from your SST apps. It's deployed using a CloudFormation stack.
This process of adding a log subscriber might fail if we:
You can see these errors in the Issues tab. Once you've fixed these issues, you can hit Retry and it'll try attaching the subscriber again.
AWS will bill you for the Lambda function log subscriber that's in your account. This is usually fairly minimal.
Even if your apps are generating an infinite number of errors, the Lambda function is limited to a concurrency of 10. So the maximum you'll be charged $43 x 10 = $430 per month x # of regions that are being monitored.
You can also disable Issues from your workspace settings, if you are using a separate service for monitoring.
Learn more about Lambda pricing.
Each update in your app also gets a unique URL, a permalink. This is printed out by the SST CLI.
↗ Permalink https://sst.dev/u/318d3879
You can view these updates in the Console. Each update shows:
The permalink is useful for sharing with your team and debugging any issues with your deploys.
<picture> <source srcset={consoleUpdatesDark.src} media="(prefers-color-scheme: dark)" /> <source srcset={consoleUpdatesLight.src} media="(prefers-color-scheme: light)" /> <Image src={consoleUpdatesLight} alt="SST Console Updates" /> </picture>The CLI updates your state with the event log from each update and generated a globally unique id. If your AWS account is connected to the Console, it'll pull the state and event log to generate the details for the update permalink.
When you visit the permalink, the Console looks up the id of the update and redirects you to the right app in your workspace.
The Console shows you the complete state of the resources in your app. You can view:
The Console can auto-deploy your apps when you git push to your GitHub repo. Autodeploy uses AWS CodeBuild in your account to run the build.
<picture> <source srcset={consoleAutodeployDark.src} media="(prefers-color-scheme: dark)" /> <source srcset={consoleAutodeployLight.src} media="(prefers-color-scheme: light)" /> <Image src={consoleAutodeployLight} alt="SST Console Autodeploy" /> </picture>We designed Autodeploy to be a better fit for SST apps when compared to alternatives like GitHub Actions or CircleCI.
sst.config.ts.To get started with Autodeploy:
Enable the GitHub integration
Head over to your Workspace settings > Integrations and enable GitHub. This will ask you to login to GitHub and you'll be asked to pick the GitHub organization or user you want to link to.
:::tip You can only associate your workspace with a single GitHub org. :::
If you have multiple GitHub orgs, you can create multiple workspaces in the Console.
Connect a repo
To auto-deploy an app, head over to the App's Settings > Autodeploy and select the repo for the app.
Configure an environment
Next you can configure a branch or PR environment by selecting the stage you want deployed to an AWS account. You can optionally configure environment variables as well.
:::note Stage names by default are generated based on the branch or PR. :::
By default, stages are based on the branch name or PR. We'll look at this in detail below.
Git push
Finally, git push to the environment you configured and head over to your app's Autodeploy tab to see it in action.
:::note PR stages are removed when the PR is closed while branch stages are not. :::
For example, if you configure a branch environment for the stage production, any git pushes to the production branch will be auto-deployed. Similarly, if you create a new PR, say PR#12, the Console will auto-deploy a stage called pr-12.
You can also manually trigger a deployment through the Console by passing in a Git ref and the stage you want to deploy to.
Setup alerts
Once your deploys are working, you can set the Console to send alerts for your deploys. Head over to your Workspace Settings > Alerts and add a new alert to be notified on any Autodeploys, or only on Autodeploy errors.
:::tip
You can configure how Autodeploy works through your sst.config.ts.
:::
While Autodeploy supports the standard branch and PR workflow out of the box, it can be configured in depth through your sst.config.ts.
The above can be configured through the console.autodeploy option in the sst.config.ts.
export default $config({
// Your app's config
app(input) { },
// Your app's resources
async run() { },
// Your app's Console config
console: {
autodeploy: {
target(event) {
if (event.type === "branch" && event.branch === "main" && event.action === "pushed") {
return { stage: "production" };
}
}
}
}
});
In the above example we are using the console.autodeploy.target option to change the stage that's tied to a git event. Only git pushes to the main branch to auto-deploy to the production stage.
This works because if target returns undefined, the deploy is skipped. And if you provide your own target callback, it overrides the default behavior.
:::tip You can use the git events to configure how your app is auto-deployed. :::
Through the console.autodeploy.runner option, you can configure the runner that's used. For example, if you wanted to increase the timeouts to 2 hours, you can.
console: {
autodeploy: {
runner: { timeout: "2 hours" }
}
}
This also takes the stage name, so you can set the runner config for a specific stage.
console: {
autodeploy: {
runner(stage) {
if (stage === "production") return { timeout: "3 hours" };
}
}
}
You can also have your builds run inside your VPC.
console: {
autodeploy: {
runner: {
vpc: {
id: "vpc-0be8fa4de860618bb",
securityGroups: ["sg-0399348378a4c256c"],
subnets: ["subnet-0b6a2b73896dc8c4c", "subnet-021389ebee680c2f0"]
}
}
}
}
Or specify files and directories to be cached.
console: {
autodeploy: {
runner: {
cache: {
paths: ["node_modules", "/path/to/cache"]
}
}
}
}
Read more about the console.autodeploy config.
The Console needs to know which account it needs to autodeploy into. You configure this under the App's Settings > Autodeploy. Each environment takes:
Stage
The stage that is being deployed. By default, the stage name comes from the name of the branch. Branch names are sanitized to only letters/numbers and hyphens. So for example:
production will deploy a stage called production.pr-12.As mentioned, above you can customize this through your sst.config.ts.
:::tip You can specify a pattern to match the stage name in your environments. :::
If multiple stages share the same environment, you can use a glob pattern. For example, pr-* matches all stages that start with pr-.
AWS Account
The AWS account that you are deploying to.
Environment Variables
Any environment variables you need for the build process. These are made available under process.env.* in your sst.config.ts.
When you git push to a branch, pull request, or tag, the following happens:
console.autodeploy.target callback.
console.autodeploy.runner. Or the defaults are used.This only applies only to git events. If you trigger a deploy through the Console, you are asked to specify the stage you want to deploy to. So in this case, it skips step 1 from above and does not call console.autodeploy.target.
Both target and runner are optional and come with defaults, but they can be customized.
AWS will bill you for the CodeBuild build minutes that are used to run your builds. Learn more about CodeBuild pricing.
When the Console starts up, it checks if you are running sst dev locally. If so, then it'll show you real-time logs from your local terminal. This works by connecting to a local server that's run as a part of the SST CLI.
:::info
The local server only allows access from localhost and console.sst.dev.
:::
The local logs works in all browsers and environments. But for certain browsers like Safari or Brave, and Gitpod, it needs some additional configuration.
Certain browsers like Safari and Brave require the local connection between the browser and the sst dev CLI to be running on HTTPS.
SST can automatically generate a locally-trusted certificate using the sst cert command.
sst cert
You'll only need to run this once on your machine.
If you are using Gitpod, you can use the Gitpod Local Companion app to connect to the sst dev process running inside your Gitpod workspace.
To get started:
The companion app runs locally and creates a tunnelled connection to your Gitpod workspace.
Here are some frequently asked questions about the Console.
Do I need to use the Console to use SST?
You don't need the Console to use SST. It compliments the CLI and has some features that help with managing your apps in production.
That said, it is completely free to get started. You can create an account and invite your team, without having to add a credit card.
Is there a free tier?
If your workspace has 350 active resources or fewer for the month, it's considered to be in the free tier. This count also resets every month.
What happens if I go over the free tier?
You won't be able to access the production or deployed stages till you add your billing details in the workspace settings.
Note that, you can continue to access your personal stages. Just make sure you have sst dev running locally. Otherwise the Console won't be able to detect that it's a personal stage.
What counts as a resource?
Resources are what SST creates in your cloud provider. This includes the resources created by both SST's built-in components, like Function, Nextjs, Bucket, and the ones created by any other Terraform/Pulumi provider.
Some components, like Nextjs and StaticSite, create multiple resources. In general, the more complex the component, the more resources it'll create.
You can see a full list of resources if you go to an app in your Console and navigate to a stage in it.
For some context, the Console is itself a pretty large SST app and it has around 320 resources.
Do PR stages also count?
A stage has to be around for at least 2 weeks before the resources in it are counted as active. So if a PR stage is created and removed within 2 weeks, they don't count.
However, if you remove a stage and create a new one with the same name, it does not reset the 2 week initial period.
Here were some frequently asked questions about the old pricing plan for the Console.
Do I need to switch to the new pricing?
If you are currently on the old plan, you don't have to switch and you won't be automatically switched over either.
You can go to the workspace settings and check out how much you'll be billed based on both the plans. To switch over, you can cancel your current plan and then subscribe to the new plan.
At some point in the future, we'll remove the old plan. But there's no specific timeline for it yet.
Which Lambda functions are included in the number of invocations?
The number of invocations are only counted for the Lambda functions in your SST apps. Other Lambda functions in your AWS accounts are not included.
Do the functions in my personal stages count as a part of the invocations?
Lambda functions that are invoked locally are not included.
My invocation volume is far higher than the listed tiers. Are there any other options?
Feel free to contact us and we can figure out a pricing plan that works for you.
If you have any further questions, feel free to send us an email.