Skip to main content
The Aurora component lets you add an Amazon Aurora Serverless v2 database cluster to your app.

Constructor

sst.config.ts
const database = new sst.aws.Aurora("MyDatabase");

Parameters

vpc

vpc
Vpc
required
The VPC to place the database cluster in.
{
  vpc: myVpc
}

engine

engine
string
default:"postgres"
The database engine. Either "postgres" or "mysql".
{
  engine: "mysql"
}

version

version
string
The database engine version.
{
  version: "15.4"
}

scaling

scaling
object
Configure autoscaling for the Aurora Serverless cluster.
{
  scaling: {
    min: "0.5 ACU",
    max: "4 ACU"
  }
}

Properties

clusterEndpoint

port

database

SDK

Access the database connection info:
src/lambda.ts
import { Resource } from "sst";

console.log(Resource.MyDatabase.clusterEndpoint);

Examples

Create an Aurora cluster

sst.config.ts
const vpc = new sst.aws.Vpc("MyVpc");
const database = new sst.aws.Aurora("MyDatabase", { vpc });

Configure MySQL

sst.config.ts
new sst.aws.Aurora("MyDatabase", {
  vpc,
  engine: "mysql",
  version: "8.0.mysql_aurora.3.05.2"
});

Build docs developers (and LLMs) love