anomalyco/sst · error · VisibleError

Storage must be at least 20 GB for the ${name} MySQL databas

Error message

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

What it means

SST validates the requested storage size for an RDS MySQL instance during normalization. AWS requires at least 20 GB of allocated storage, so any smaller value passed via the `storage` argument throws this VisibleError at synth time.

Source

Thrown at platform/src/components/aws/mysql.ts:565

          throw new VisibleError(`Failed to get password for MySQL ${name}.`);

        const secret = secretsmanager.getSecretVersionOutput(
          { secretId: passwordTag },
          { parent: self },
        );
        return $jsonParse(secret.secretString).apply(
          (v) => v.password as string,
        );
      });

      return { instance, proxy, password };
    }

    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} MySQL database.`,
          );
        }
        if (size > 65536) {
          throw new VisibleError(
            `Storage cannot be greater than 65536 GB (64 TB) for the ${name} MySQL 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 the storage argument to at least "20 GB"
  2. Remove the storage argument entirely to use the default of 20 GB
  3. Check units: use GB/TB strings like "25 GB" or "100 GB"

Example fix

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

Strategy: validation

Validate before calling

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

Prevention

When it happens

Trigger: new sst.aws.MySql("MyDb", { storage: "10 GB" }) or any storage value whose toGBs() conversion is below 20.

Common situations: Setting storage to small values like "5 GB" or "10 GB" copied from local-database configs; typos in units causing the parser to compute a tiny size.

Related errors


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