{"record":{"id":"9bde8a82a1f90811","repo":"anomalyco/sst","slug":"you-are-using-the-vpc-v1-component-please-migra-9bde8a","errorCode":null,"errorMessage":"You are using the \"Vpc.v1\" component. Please migrate to the latest \"Vpc\" component.","messagePattern":"You are using the \"Vpc\\.v1\" component\\. Please migrate to the latest \"Vpc\" component\\.","errorType":"exception","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/postgres.ts","lineNumber":610,"sourceCode":"        const size = toGBs(v);\n        if (size < 20) {\n          throw new VisibleError(\n            `Storage must be at least 20 GB for the ${name} Postgres database.`,\n          );\n        }\n        if (size > 65536) {\n          throw new VisibleError(\n            `Storage cannot be greater than 65536 GB (64 TB) for the ${name} Postgres database.`,\n          );\n        }\n        return size;\n      });\n    }\n\n    function normalizeVpc() {\n      // \"vpc\" is a Vpc.v1 component\n      if (args.vpc instanceof VpcV1) {\n        throw new VisibleError(\n          `You are using the \"Vpc.v1\" component. Please migrate to the latest \"Vpc\" component.`,\n        );\n      }\n\n      // \"vpc\" is a Vpc component\n      if (args.vpc instanceof Vpc) {\n        return {\n          subnets: args.vpc.privateSubnets,\n        };\n      }\n\n      // \"vpc\" is object\n      return output(args.vpc);\n    }\n\n    function registerDev() {\n      if (!args.dev) return undefined;\n","sourceCodeStart":592,"sourceCodeEnd":628,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/postgres.ts#L592-L628","documentation":"SST renamed/reworked its VPC component; the old version is still importable as Vpc.v1 but is no longer accepted by newer components like Postgres. Passing a Vpc.v1 instance to Postgres throws this VisibleError directing the user to migrate to the latest Vpc component.","triggerScenarios":"Constructing a Vpc via the legacy `sst.aws.Vpc.v1` class and passing that instance in the `vpc` property of a Postgres component.","commonSituations":"Upgrading SST where docs/examples still show the old Vpc API; partially-migrated configs where some components use the new Vpc and others still import Vpc.v1.","solutions":["Replace Vpc.v1 usage with the latest sst.aws.Vpc component and update its args to the new API","Follow SST's Vpc migration guide for the argument changes","Ensure all components share the single new Vpc instance"],"exampleFix":"// before\nconst vpc = new sst.aws.Vpc.v1(\"MyVpc\", { nat: \"auto\" });\nnew sst.aws.Postgres(\"MyPostgres\", { vpc });\n// after\nconst vpc = new sst.aws.Vpc(\"MyVpc\", { nat: \"auto\" });\nnew sst.aws.Postgres(\"MyPostgres\", { vpc });","handlingStrategy":"validation","validationCode":"import { Vpc, Vpc as VpcLatest } from \"sst/aws\";\n// ensure the vpc arg is an instance of the latest Vpc class, not Vpc.v1\nif ((args.vpc as any)?.constructor?.name?.includes(\"v1\"))\n  throw new Error(\"Use the latest sst.aws.Vpc component, not Vpc.v1\");","typeGuard":"function isCurrentVpc(v: unknown): v is InstanceType<typeof VpcLatest> {\n  return v instanceof VpcLatest;\n}","tryCatchPattern":"try {\n  new sst.aws.Postgres(\"MyPostgres\", { vpc });\n} catch (e) {\n  if (String(e).includes(\"Vpc.v1\")) {\n    console.error(\"Replace Vpc.v1 with the latest sst.aws.Vpc component (see SST Vpc migration guide)\");\n  }\n  throw e;\n}","preventionTips":["After upgrading SST, grep sst.config.ts for \"Vpc.v1\" and migrate to \"Vpc\"","Import Vpc only from the current sst.aws namespace","Follow the SST changelog/migration guide when bumping versions"],"tags":["vpc","migration","deprecated-api","postgres"],"backgroundTag":"deprecated-component-version","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}