{"record":{"id":"c59230b4f765350c","repo":"anomalyco/sst","slug":"the-vpc-subnets-property-has-been-renamed-to-vp","errorCode":null,"errorMessage":"The \"vpc.subnets\" property has been renamed to \"vpc.privateSubnets\". Update your code to use \"vpc.privateSubnets\" instead.","messagePattern":"The \"vpc\\.subnets\" property has been renamed to \"vpc\\.privateSubnets\"\\. Update your code to use \"vpc\\.privateSubnets\" instead\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/function.ts","lineNumber":2060,"sourceCode":"        };\n        return all([\n          args.vpc.id,\n          args.vpc.nodes.natGateways,\n          args.vpc.nodes.natInstances,\n        ]).apply(([id, natGateways, natInstances]) => {\n          if (natGateways.length === 0 && natInstances.length === 0) {\n            warnOnce(\n              `\\nWarning: One or more functions are deployed in the \"${id}\" VPC, which does not have a NAT gateway. As a result, these functions cannot access the internet. If your functions need internet access, enable it by setting the \"nat\" prop on the \"Vpc\" component.\\n`,\n            );\n          }\n          return result;\n        });\n      }\n\n      return output(args.vpc).apply((vpc) => {\n        // \"vpc\" is object\n        if (vpc.subnets) {\n          throw new VisibleError(\n            `The \"vpc.subnets\" property has been renamed to \"vpc.privateSubnets\". Update your code to use \"vpc.privateSubnets\" instead.`,\n          );\n        }\n\n        return vpc;\n      });\n    }\n\n    function normalizeDurable() {\n      if (!args.durable) return;\n      const config = args.durable === true ? {} : args.durable;\n      return {\n        timeout: output(config.timeout).apply((v) =>\n          toSeconds(v ?? \"14 days\"),\n        ),\n        retention: output(config.retention).apply((v) =>\n          toDays(v ?? \"30 days\"),\n        ),","sourceCodeStart":2042,"sourceCodeEnd":2078,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/function.ts#L2042-L2078","documentation":"The Function component's `vpc` option renamed `subnets` to `privateSubnets` in a breaking change. normalizeVpc() detects the old key and throws a VisibleError telling you to update your code, rather than silently misconfiguring VPC placement.","triggerScenarios":"Passing vpc: { subnets: [...] } (with securityGroups or as an object) to new sst.aws.Function in a version of SST that expects vpc.privateSubnets.","commonSituations":"Upgrading SST across a major version and keeping old vpc config; copy-pasting VPC snippets from older blog posts or repos.","solutions":["Rename `subnets` to `privateSubnets` in the vpc object","Check the SST migration guide for other vpc-related renames (e.g. placement of securityGroups)","Pin your previous SST version only as a temporary measure while migrating"],"exampleFix":"// before\nvpc: { subnets: privateSubnetIds }\n// after\nvpc: { privateSubnets: privateSubnetIds }","handlingStrategy":"validation","validationCode":"if (args.vpc && typeof args.vpc === \"object\" && \"subnets\" in args.vpc)\n  throw new Error('vpc.subnets renamed to vpc.privateSubnets — update your config');","typeGuard":"function usesRenamedSubnets(vpc: unknown): boolean {\n  return !!vpc && typeof vpc === \"object\" && \"subnets\" in vpc;\n}","tryCatchPattern":"try {\n  new sst.aws.Function(\"Fn\", args);\n} catch (e) {\n  if ((e as Error).message.includes(\"privateSubnets\")) {\n    console.error(\"Rename vpc.subnets to vpc.privateSubnets\");\n  }\n  throw e;\n}","preventionTips":["After SST upgrades, run sst dev once and fix all VisibleError migration messages","Read the SST changelog/migration guide for breaking config renames","Use TypeScript types on args so unknown keys like `subnets` fail typecheck first"],"tags":["aws","lambda","vpc","breaking-change","renamed-property"],"backgroundTag":"renamed-config-property","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}