{"record":{"id":"2f2bc68679839522","repo":"anomalyco/sst","slug":"cannot-create-more-than-15-read-only-replicas-for","errorCode":null,"errorMessage":"Cannot create more than 15 read-only replicas for the \"${name}\" Aurora database.","messagePattern":"Cannot create more than 15 read-only replicas for the \"(.+?)\" Aurora database\\.","errorType":"exception","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/aurora.ts","lineNumber":812,"sourceCode":"          throw new VisibleError(\n            `Cannot configure \"pauseAfter\" when the minimum ACU is not 0 for the \"${name}\" Aurora database.`,\n          );\n        }\n\n        return {\n          max,\n          min,\n          pauseAfter: isAutoPauseEnabled\n            ? scaling?.pauseAfter ?? \"5 minutes\"\n            : undefined,\n        };\n      });\n    }\n\n    function normalizeReplicas() {\n      return output(args.replicas ?? 0).apply((replicas) => {\n        if (replicas > 15) {\n          throw new VisibleError(\n            `Cannot create more than 15 read-only replicas for the \"${name}\" Aurora database.`,\n          );\n        }\n        return replicas;\n      });\n    }\n\n    function normalizeVpc() {\n      // \"vpc\" is a Vpc component\n      if (args.vpc instanceof Vpc) {\n        return {\n          subnets: args.vpc.privateSubnets,\n          securityGroups: args.vpc.securityGroups,\n        };\n      }\n\n      // \"vpc\" is object\n      return output(args.vpc);","sourceCodeStart":794,"sourceCodeEnd":830,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/aurora.ts#L794-L830","documentation":"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.","triggerScenarios":"Passing `replicas: 16` (or any number > 15) to `new sst.aws.Aurora(...)` or `sst.aws.AuroraPostgres(...)`.","commonSituations":"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.","solutions":["Reduce `replicas` to 15 or fewer","If you need more read capacity, add additional Aurora clusters or increase instance size instead of reader count","If replicas comes from a variable, clamp it: `Math.min(value, 15)`"],"exampleFix":"// before\nnew sst.aws.Aurora(\"DB\", { replicas: 20 });\n// after\nnew sst.aws.Aurora(\"DB\", { replicas: 15 });","handlingStrategy":"validation","validationCode":"const replicas = args.replicas ?? 0;\nif (replicas > 15)\n  throw new Error(`Aurora supports at most 15 read replicas, got ${replicas}`);\nconst safeReplicas = Math.min(replicas, 15);","typeGuard":"function isWithinReplicaLimit(n) {\n  return Number.isInteger(n) && n >= 0 && n <= 15;\n}","tryCatchPattern":"null","preventionTips":["Clamp replica counts from env/variables with Math.min(value, 15)","Remember Aurora's hard 15-reader limit when planning read scaling; scale instance size instead","Add a unit test for replica config edge values (0, 15, 16)"],"tags":["aurora","rds","limits","config-validation"],"backgroundTag":"aws-service-limit","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}