{"record":{"id":"e49aba2aa6b963a1","repo":"remotion-dev/remotion","slug":"region-is-not-a-supported-aws-region-must-be-o","errorCode":null,"errorMessage":"${region} is not a supported AWS region. Must be one of: ${AWS_REGIONS.join(', ')}","messagePattern":"(.+?) is not a supported AWS region\\. Must be one of: (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/lambda-client/src/validate-aws-region.ts","lineNumber":8,"sourceCode":"import type {AwsRegion} from './regions';\nimport {AWS_REGIONS} from './regions';\n\nexport function validateAwsRegion(\n\tregion: unknown,\n): asserts region is AwsRegion {\n\tif (!AWS_REGIONS.includes(region as AwsRegion)) {\n\t\tthrow new TypeError(\n\t\t\t`${region} is not a supported AWS region. Must be one of: ${AWS_REGIONS.join(\n\t\t\t\t', ',\n\t\t\t)}`,\n\t\t);\n\t}\n}\n","sourceCodeStart":1,"sourceCodeEnd":15,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-client/src/validate-aws-region.ts#L1-L15","documentation":"validateAwsRegion asserts that the supplied region is in the AWS_REGIONS allowlist. If not, it throws a TypeError listing every supported region. This guards every API that takes a region so an invalid/typo'd region fails fast with a clear enumeration rather than an opaque AWS error later.","triggerScenarios":"Calling any Lambda-client API that runs validateAwsRegion(region) with a region string not present in AWS_REGIONS (e.g., 'us-east-2 ' with trailing space, 'us-east1', 'us-east-1a' (an AZ), 'cn-north-1' unsupported).","commonSituations":"Typo in region env var; using an Availability Zone ID instead of a region; trailing whitespace from copy/paste; pointing at a region not yet supported by Remotion Lambda; using a non-AWS partition region (China/GovCloud) that is not in the allowlist.","solutions":["Use one of the regions listed in the error message.","Strip whitespace from the region value before passing it.","If you need an unsupported region, request support or use the closest supported one.","Confirm the region matches where your Lambda function was deployed."],"exampleFix":"// before\nvalidateAwsRegion('us-east-1 ');\n\n// after\nvalidateAwsRegion('us-east-1');","handlingStrategy":"type-guard","validationCode":"import { AWS_REGIONS } from '@remotion/lambda-client';\nconst region = String(rawRegion).trim();\nif (!AWS_REGIONS.includes(region as any)) {\n  throw new Error(`Unsupported region: ${rawRegion}. Supported: ${AWS_REGIONS.join(', ')}`);\n}","typeGuard":"import type { AwsRegion } from '@remotion/lambda-client';\nimport { AWS_REGIONS } from '@remotion/lambda-client';\nconst isAwsRegion = (r: unknown): r is AwsRegion =>\n  typeof r === 'string' && (AWS_REGIONS as readonly string[]).includes(r);","tryCatchPattern":null,"preventionTips":["Trim whitespace from region values read from env/CLI.","Maintain a dropdown/enum of supported regions in your UI.","Validate the region at config load, not at render time."],"tags":["input-validation","aws","region","typescript"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}