anomalyco/sst · error · VisibleError

Cannot create more than 15 read-only replicas for the "${nam

Error message

Cannot create more than 15 read-only replicas for the "${name}" Aurora database.

What it means

Aurora clusters support at most 15 read-only (reader) DB instances. SST validates the `replicas` count up front and fails the deployment with a VisibleError instead of letting CloudFormation/CFN fail later with a less clear AWS error.

Source

Thrown at platform/src/components/aws/aurora.ts:812

          throw new VisibleError(
            `Cannot configure "pauseAfter" when the minimum ACU is not 0 for the "${name}" Aurora database.`,
          );
        }

        return {
          max,
          min,
          pauseAfter: isAutoPauseEnabled
            ? scaling?.pauseAfter ?? "5 minutes"
            : undefined,
        };
      });
    }

    function normalizeReplicas() {
      return output(args.replicas ?? 0).apply((replicas) => {
        if (replicas > 15) {
          throw new VisibleError(
            `Cannot create more than 15 read-only replicas for the "${name}" Aurora database.`,
          );
        }
        return replicas;
      });
    }

    function normalizeVpc() {
      // "vpc" is a Vpc component
      if (args.vpc instanceof Vpc) {
        return {
          subnets: args.vpc.privateSubnets,
          securityGroups: args.vpc.securityGroups,
        };
      }

      // "vpc" is object
      return output(args.vpc);

View on GitHub (pinned to a0bd20f762)

Solutions

  1. Reduce `replicas` to 15 or fewer
  2. If you need more read capacity, add additional Aurora clusters or increase instance size instead of reader count
  3. If replicas comes from a variable, clamp it: `Math.min(value, 15)`

Example fix

// before
new sst.aws.Aurora("DB", { replicas: 20 });
// after
new sst.aws.Aurora("DB", { replicas: 15 });
Defensive patterns

Strategy: validation

Validate before calling

const replicas = args.replicas ?? 0;
if (replicas > 15)
  throw new Error(`Aurora supports at most 15 read replicas, got ${replicas}`);
const safeReplicas = Math.min(replicas, 15);

Type guard

function isWithinReplicaLimit(n) {
  return Number.isInteger(n) && n >= 0 && n <= 15;
}

Try / catch

null

Prevention

When it happens

Trigger: Passing `replicas: 16` (or any number > 15) to `new sst.aws.Aurora(...)` or `sst.aws.AuroraPostgres(...)`.

Common situations: Misconfiguring replicas from an env variable or loop count (e.g. `replicas: parseInt(process.env.REPLICAS)`), or scaling misguidedly with readers instead of resizing the writer instance.

Related errors


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