{"record":{"id":"3623c104cd2e7d6f","repo":"anomalyco/sst","slug":"invalid-aws-region-region-please-specify-a","errorCode":null,"errorMessage":"Invalid AWS region: \"${region}\". Please specify a valid AWS region.","messagePattern":"Invalid AWS region: \"(.+?)\"\\. Please specify a valid AWS region\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/ssr-site.ts","lineNumber":1246,"sourceCode":"        return regions.map((region) => {\n          if (\n            [\n              \"ap-south-2\",\n              \"ap-southeast-4\",\n              \"ap-southeast-5\",\n              \"ca-west-1\",\n              \"eu-south-2\",\n              \"eu-central-2\",\n              \"il-central-1\",\n              \"me-central-1\",\n            ].includes(region)\n          )\n            throw new VisibleError(\n              `Region ${region} is not supported by this component. Please select a different AWS region.`,\n            );\n\n          if (!Object.values(Region).includes(region as Region))\n            throw new VisibleError(\n              `Invalid AWS region: \"${region}\". Please specify a valid AWS region.`,\n            );\n          return region as Region;\n        });\n      });\n    }\n\n    function normalizeRoute() {\n      const route = normalizeRouteArgs(args.router, args.route);\n\n      if (route) {\n        if (args.domain)\n          throw new VisibleError(\n            `Cannot provide both \"domain\" and \"route\". Use the \"domain\" prop on the \"Router\" component when serving your site through a Router.`,\n          );\n\n        if (args.edge)\n          throw new VisibleError(","sourceCodeStart":1228,"sourceCodeEnd":1264,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/ssr-site.ts#L1228-L1264","documentation":"After checking the region is in SST's supported allow-list, `normalizeRegions` also verifies each region is a real AWS region by membership in the `Region` enum. If the string is not a valid AWS region at all (bad format, typo, non-AWS region id), this error is thrown naming the value.","triggerScenarios":"Passing a malformed region string in `regions`, e.g. `regions: [\"us-east1\"]` (missing hyphen), `regions: [\"east-us-1\"]`, or a GCP/Azure region id.","commonSituations":"Hand-typed region names with typos; generating region lists programmatically and concatenating wrong; confusing availability-zone names (us-east-1a) with region names.","solutions":["Correct the region string to a valid AWS region identifier (e.g. \"us-east-1\")","Use an IDE autocomplete on the `Region` enum to pick a valid value","Validate the list before passing it into the component"],"exampleFix":"// before\nnew sst.aws.NextjsSite(\"Web\", { path: \"src\", regions: [\"us-east1\"] });\n// after\nnew sst.aws.NextjsSite(\"Web\", { path: \"src\", regions: [\"us-east-1\"] });","handlingStrategy":"validation","validationCode":"const AWS_REGION_RE = /^(us|eu|ap|sa|ca|me|af|il|cn)-[a-z]+-\\d$/;\nfor (const r of regions) if (!AWS_REGION_RE.test(r)) throw new Error(`Invalid AWS region: ${r}`);","typeGuard":"function isValidAwsRegion(r: string): boolean {\n  return /^(us|eu|ap|sa|ca|me|af|il|cn)-[a-z]+-\\d$/.test(r);\n}","tryCatchPattern":"try {\n  new sst.aws.NextjsSite(\"Web\", { path: \"src\", regions });\n} catch (e) {\n  if (String(e).includes(\"Invalid AWS region\")) console.error(\"Fix the region identifier format\");\n  throw e;\n}","preventionTips":["Copy region strings from AWS docs, never hand-type","Strip availability-zone suffixes (us-east-1a -> us-east-1) when building lists","Centralize region constants in one typed module"],"tags":["ssr-site","regions","validation","aws"],"backgroundTag":"invalid-region","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}