How Aurora Serverless v2 capacity works for PostgreSQL, what an ACU is, the current state of scaling to zero with automatic pause, the CLI and Terraform setup, how to convert a provisioned cluster, what it costs, and when provisioned RDS or Aurora is the better choice, plus how to run it with Encore.

Aurora Serverless v2 is an Aurora DB instance class, db.serverless, whose capacity moves up and down with load instead of being fixed by an instance size. For PostgreSQL it is the same Aurora engine and storage as a provisioned cluster, so the database, endpoints and drivers do not change, only how compute is sized and billed.
Short answer: Aurora Serverless v2 measures capacity in Aurora capacity units (ACUs) of about 2 GiB of memory each, scales each instance within a cluster-wide range in steps as small as 0.5 ACU, and bills per second. As of November 2026 it can scale to zero: set the minimum to 0 ACUs and idle instances pause after a timeout you choose, with no instance charge while paused and a resume of about 15 seconds on the next connection.
This guide covers how capacity and scale to zero work, setup with the CLI and Terraform, converting a provisioned cluster, cost, when provisioned RDS is the better pick, and how to run it with Encore.
Ranges and version requirements are from how Aurora Serverless v2 works.
AWS announced scaling to zero on November 20, 2024, replacing the old floor of 0.5 ACUs. The auto-pause documentation describes the current behavior:
SecondsUntilAutoPause sets how long an instance must go without user connections before it pauses, from 300 seconds, the default, to 86,400 seconds.ServerlessV2Usage metric drops to zero. Storage and other cluster-level charges continue.Several things keep instances awake even with a minimum of 0 ACUs:
Readers with a failover priority of 2 to 15 can pause on their own while the writer stays active, which suits a reporting reader used only during office hours.
You set one capacity range on the cluster, and every db.serverless writer or reader scales independently within it. Capacity is measured every second and grows in steps as small as 0.5 ACU, with larger steps at higher capacity, so an instance at 32 ACUs adds capacity faster than one at 1 ACU.
The minimum matters for more than cost, since memory for the PostgreSQL buffer cache shrinks as an instance scales down, so a minimum set too low evicts hot data and the next burst starts with cold reads. The capacity guidance suggests a minimum whose memory holds the frequently accessed data, and a reader minimum close to the writer's to avoid replication lag. For PostgreSQL, max_connections is derived from the maximum ACUs, but a minimum of 0 or 0.5 ACUs caps it at 2,000, so use a minimum of 1 or more for connection-heavy workloads.
The CloudWatch metrics ServerlessDatabaseCapacity and ACUUtilization show where an instance sits in its range. An instance pinned at the maximum needs a higher ceiling, and one that never drops below a level is a hint for the minimum.
The capacity range belongs to the cluster, and the instance class belongs to each instance:
Setting a nonzero minimum removes SecondsUntilAutoPause from the configuration, and setting the minimum back to 0 lets you specify it again.
The aws_rds_cluster resource takes a serverlessv2_scaling_configuration block, and each aws_rds_cluster_instance uses db.serverless:
# aurora_serverless.tf
resource "aws_rds_cluster" "app" {
cluster_identifier = "app-pg"
engine = "aurora-postgresql"
engine_version = "17.4"
database_name = "app"
master_username = "postgres"
manage_master_user_password = true
storage_encrypted = true
db_subnet_group_name = var.db_subnet_group
vpc_security_group_ids = [var.db_security_group_id]
serverlessv2_scaling_configuration {
min_capacity = 0 # 0 lets idle instances pause
max_capacity = 16 # about 32 GiB of memory at peak
seconds_until_auto_pause = 900
}
}
resource "aws_rds_cluster_instance" "writer" {
identifier = "app-pg-1"
cluster_identifier = aws_rds_cluster.app.id
instance_class = "db.serverless"
engine = aws_rds_cluster.app.engine
engine_version = aws_rds_cluster.app.engine_version
}
variable "db_subnet_group" {
type = string
}
variable "db_security_group_id" {
type = string
}
A cluster can mix provisioned and db.serverless instances, for example a provisioned writer sized for steady load and a serverless reader for spiky reporting queries. Add more aws_rds_cluster_instance resources for readers.
An existing provisioned instance converts by modifying its class to db.serverless. If it is the first serverless instance in the cluster, you set the cluster's capacity range in the same operation, per the Aurora Serverless v2 administration guide. To keep downtime low for the writer:
db.serverless reader, or convert an existing reader, and let it catch up.The same steps in reverse move a workload back to provisioned, which you may need if it outgrows the largest ACU setting. RDS for PostgreSQL instances have no serverless class, so moving from RDS to Aurora Serverless v2 is a migration to Aurora first. The Aurora vs RDS guide covers that choice.
The worked example on the Aurora pricing page uses $0.12 per ACU-hour for Aurora Standard and $0.156 per ACU-hour for I/O-Optimized. Prices vary by region, and at those rates the compute side looks like this:
Storage, and I/O on Aurora Standard, come on top in every row. The first two rows are where serverless wins: compute follows usage, and a paused development database costs only its storage. The third row is a steady workload, and before choosing serverless for it, compare the result with the on-demand or reserved price of a provisioned instance of similar memory in your region.
Serverless is also a poor fit when something must hold connections open, like RDS Proxy or logical replication to an analytics pipeline, since the instance can never pause, and when the workload sits near the top of the range all day.
pg_cron, and jobs due while it sleeps are skipped. Trigger them from the application instead, where the connection itself resumes the instance.Encore gives you infrastructure from code for databases: you declare a PostgreSQL database next to the service that uses it, and in an AWS environment Encore provisions the database server in your own account. When the environment is created you choose between Amazon RDS for PostgreSQL, the default, and Aurora PostgreSQL. On Aurora, the AWS infrastructure docs describe Serverless v2 support directly: set an instance's class to db.serverless and the cluster's capacity range, between 0 and 256 ACUs in steps of 0.5, and a minimum of 0 lets the instances pause when idle. These are settings in the environment's infrastructure page, not code, so the same application can run on a provisioned Aurora writer in production and a serverless one in staging.
Run in your terminal to get started locally.
// reports/encore.service.ts
import { Service } from "encore.dev/service";
export default new Service("reports");
-- reports/migrations/1_create_reports.up.sql
CREATE TABLE reports (
id BIGSERIAL PRIMARY KEY,
tenant_id TEXT NOT NULL,
title TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX reports_tenant_created ON reports (tenant_id, created_at DESC);
// reports/reports.ts
import { api } from "encore.dev/api";
import { SQLDatabase } from "encore.dev/storage/sqldb";
// The same declaration runs on RDS, provisioned Aurora or Aurora Serverless v2.
const db = new SQLDatabase("reports", { migrations: "./migrations" });
interface Report {
id: number;
title: string;
createdAt: string;
}
export const create = api(
{ expose: true, method: "POST", path: "/tenants/:tenantId/reports" },
async ({ tenantId, title }: { tenantId: string; title: string }): Promise<Report> => {
const row = await db.queryRow<Report>`
INSERT INTO reports (tenant_id, title)
VALUES (${tenantId}, ${title})
RETURNING id, title, created_at::text AS "createdAt"
`;
return row!;
},
);
export const list = api(
{ expose: true, method: "GET", path: "/tenants/:tenantId/reports" },
async ({ tenantId }: { tenantId: string }): Promise<{ reports: Report[] }> => {
const reports: Report[] = [];
for await (const row of db.query<Report>`
SELECT id, title, created_at::text AS "createdAt"
FROM reports
WHERE tenant_id = ${tenantId}
ORDER BY created_at DESC
LIMIT 50
`) {
reports.push(row);
}
return { reports };
},
);
encore run starts a local PostgreSQL for this code, and in the cloud Encore injects the connection configuration, as the database docs explain, so nothing in the service refers to ACUs, instance classes or endpoints. Encore runs migrations on deploy and gives each service its own database role. A new Aurora cluster starts with one db.r6g.large writer and max_connections of 1000; switching that writer to db.serverless and setting the range happens in the dashboard, and changing max connections or the PostgreSQL version reboots the instances. The infrastructure overview covers what each environment type gets.
Two decisions stay with you, and the first is the server type: the RDS or Aurora choice is made when the environment is created and cannot be changed afterwards, so pick Aurora for any environment that should scale to zero. Second, the pause rules above still apply: an instance only pauses once every connection is closed, so measure with ServerlessDatabaseCapacity whether a staging environment reaches zero. If you already run an Aurora Serverless v2 cluster, you can import the existing cluster, and Encore keeps its settings and instances as they are.
An AI coding agent adding a table or a query to this service writes a migration and SQL, and the decision between provisioned and serverless capacity stays an environment setting it never has to touch.
Best fit: teams on AWS that want serverless Postgres for idle environments and provisioned capacity for steady production, from one codebase.
Aurora Serverless v2 can scale to zero: with a minimum capacity of 0 ACUs, Aurora Serverless v2 instances pause after a period with no user connections, from 300 seconds to one day, and you pay no instance charge while paused. Aurora PostgreSQL needs version 13.15, 14.12, 15.7, 16.3, 17.4, 18.3 or higher. Resuming typically takes about 15 seconds, and 30 seconds or more after a pause longer than 24 hours.
An Aurora capacity unit is approximately 2 GiB of memory with corresponding CPU and networking. You set a minimum and maximum ACU range for the cluster, and each db.serverless instance scales within it in steps as small as 0.5 ACU, billed per second in ACU-hours.
Run aws rds create-db-cluster with --engine aurora-postgresql, a supported --engine-version and --serverless-v2-scaling-configuration MinCapacity=0,MaxCapacity=16,SecondsUntilAutoPause=900, then add a writer with aws rds create-db-instance using --db-instance-class db.serverless and the same cluster identifier. In Terraform, set serverlessv2_scaling_configuration on aws_rds_cluster and instance_class db.serverless on aws_rds_cluster_instance.
For databases that sit idle for long stretches, such as development, preview and internal tools, it often is, because a paused instance has no compute charge. For steady production load it usually costs more, since you pay per ACU-hour all day at whatever capacity the load needs, while a provisioned instance of similar memory has a fixed hourly price.
Encore supports it on AWS environments that use Aurora PostgreSQL: you set an instance's class to db.serverless and the cluster's capacity range, between 0 and 256 ACUs in steps of 0.5, in the environment's infrastructure settings, and a minimum of 0 lets the instances pause when idle. Application code does not change.
Deploy to your cloud on AWS and Google Cloud
without managing infrastructure
Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.