anomalyco/sst · error · VisibleError

Storage must be at least 20 GB for the ${name} Postgres data

Error message

Storage must be at least 20 GB for the ${name} Postgres database.

What it means

RDS requires Postgres instances to have at least 20 GB of allocated storage. SST validates the storage arg (converted to GB) during component normalization and throws before provisioning if it's below the AWS minimum.

Source

Thrown at platform/src/components/aws/postgres.ts:594

    }

    function registerVersion(overrideVersion?: number) {
      self.registerVersion({
        new: _version,
        old: overrideVersion ?? $cli.state.version[name],
        message: [
          `This component has been renamed. Please change:\n`,
          `"sst.aws.Postgres" to "sst.aws.Postgres.v${$cli.state.version[name]}"\n`,
          `Learn more https://sst.dev/docs/components/#versioning`,
        ].join("\n"),
      });
    }

    function normalizeStorage() {
      return output(args.storage ?? "20 GB").apply((v) => {
        const size = toGBs(v);
        if (size < 20) {
          throw new VisibleError(
            `Storage must be at least 20 GB for the ${name} Postgres database.`,
          );
        }
        if (size > 65536) {
          throw new VisibleError(
            `Storage cannot be greater than 65536 GB (64 TB) for the ${name} Postgres database.`,
          );
        }
        return size;
      });
    }

    function normalizeVpc() {
      // "vpc" is a Vpc.v1 component
      if (args.vpc instanceof VpcV1) {
        throw new VisibleError(
          `You are using the "Vpc.v1" component. Please migrate to the latest "Vpc" component.`,
        );

View on GitHub (pinned to a0bd20f762)

Solutions

  1. Set storage to at least "20 GB"
  2. Remove the storage arg to use the default 20 GB

Example fix

// before
new sst.aws.Postgres("MyPostgres", { storage: "10 GB" });
// after
new sst.aws.Postgres("MyPostgres", { storage: "20 GB" });
Defensive patterns

Strategy: validation

Validate before calling

const gb = toGBs(storage);
if (gb < 20) throw new Error(`Postgres storage must be >= 20 GB, got ${storage}`);

Type guard

function isValidPostgresStorage(s: string): boolean {
  return toGBs(s) >= 20;
}

Try / catch

try {
  new sst.aws.Postgres("MyPostgres", { storage: args.storage });
} catch (e) {
  if (String(e).includes("at least 20 GB")) {
    console.error("Storage below AWS RDS minimum — use 20 GB or more");
  }
  throw e;
}

Prevention

When it happens

Trigger: Creating sst.aws.Postgres with `storage` like "10 GB" or "5 GB", which converts below the 20 GB floor.

Common situations: Downsizing storage to cut cost; copying a storage value from another component's config; typos in the storage string.

Related errors


AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30). Data as JSON: /api/errors/6048f149f77abe2f. Report an issue: GitHub.