{"record":{"id":"bb3858a77c5f3008","repo":"anomalyco/sst","slug":"you-are-using-the-vpc-v1-component-please-migra-bb3858","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/mysql.ts","lineNumber":581,"sourceCode":"        const size = toGBs(v);\n        if (size < 20) {\n          throw new VisibleError(\n            `Storage must be at least 20 GB for the ${name} MySQL database.`,\n          );\n        }\n        if (size > 65536) {\n          throw new VisibleError(\n            `Storage cannot be greater than 65536 GB (64 TB) for the ${name} MySQL 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":563,"sourceCodeEnd":599,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/mysql.ts#L563-L599","documentation":"The legacy Vpc.v1 component is not compatible with newer components like MySql, which require the redesigned Vpc component. Passing a Vpc.v1 instance to the vpc argument throws this VisibleError prompting migration.","triggerScenarios":"new sst.aws.MySql(\"MyDb\", { vpc: someVpcV1Instance }) where someVpcV1Instance was created with sst.aws.Vpc.v1.","commonSituations":"Projects mid-migration from the old Vpc component that still instantiate Vpc.v1 in some stacks; examples copied from older SST versions.","solutions":["Replace sst.aws.Vpc.v1 instantiation with the new sst.aws.Vpc component and pass that instance to MySql","Migrate VPC arguments (nat gateways, subnets, etc.) to the new Vpc component's API","Re-deploy so the new Vpc is created, then attach it to the MySQL component"],"exampleFix":"// before\nconst vpc = new sst.aws.Vpc.v1(\"MyVpc\", { nat: \"managed\" });\nnew sst.aws.MySql(\"MyDb\", { vpc });\n// after\nconst vpc = new sst.aws.Vpc(\"MyVpc\", { nat: \"managed\" });\nnew sst.aws.MySql(\"MyDb\", { vpc });","handlingStrategy":"type-guard","validationCode":"import { Vpc, Vpc as VpcNew } from \"sst/aws\";\nif (args.vpc instanceof VpcV1) throw new Error(\"Migrate Vpc.v1 to new Vpc before using with MySql\");","typeGuard":"function isLegacyVpc(v: unknown): v is VpcV1 {\n  return v instanceof VpcV1;\n}","tryCatchPattern":null,"preventionTips":["Migrate all Vpc.v1 usages to the new Vpc component first in any upgrade","Search for `Vpc.v1` during SST upgrades and remove all occurrences","Type the vpc argument as the new Vpc class so legacy instances fail typecheck","Review SST migration guides before changing shared networking components"],"tags":["vpc","mysql","aws","api-migration"],"backgroundTag":"component-version-mismatch","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}