{"record":{"id":"555909a881df5bde","repo":"remotion-dev/remotion","slug":"lambda-insights-is-not-supported-by-aws-in-region","errorCode":null,"errorMessage":"Lambda Insights is not supported by AWS in region ${region}. Please disable Lambda Insights. See http://remotion.dev/docs/lambda/insights#unsupported-regions","messagePattern":"Lambda Insights is not supported by AWS in region (.+?)\\. Please disable Lambda Insights\\. See http://remotion\\.dev/docs/lambda/insights#unsupported-regions","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/api/create-function.ts","lineNumber":148,"sourceCode":"\n\tlet vpcConfig: VpcConfig | undefined;\n\tif (vpcSubnetIds && vpcSecurityGroupIds) {\n\t\tvpcConfig = {\n\t\t\tSubnetIds: vpcSubnetIds.split(','),\n\t\t\tSecurityGroupIds: vpcSecurityGroupIds.split(','),\n\t\t};\n\t}\n\n\tRenderInternals.Log.verbose(\n\t\t{indent: false, logLevel},\n\t\t'Deploying new Lambda function',\n\t);\n\n\tconst insightsLayer = enableLambdaInsights\n\t\t? lambdaInsightsExtensions[region]\n\t\t: null;\n\tif (enableLambdaInsights && !insightsLayer) {\n\t\tthrow new Error(\n\t\t\t`Lambda Insights is not supported by AWS in region ${region}. Please disable Lambda Insights. See http://remotion.dev/docs/lambda/insights#unsupported-regions`,\n\t\t);\n\t}\n\n\tconst {FunctionName, FunctionArn} =\n\t\tawait LambdaClientInternals.getLambdaClient(\n\t\t\tregion,\n\t\t\tundefined,\n\t\t\trequestHandler,\n\t\t).send(\n\t\t\tnew CreateFunctionCommand({\n\t\t\t\tCode: {\n\t\t\t\t\tZipFile: new Uint8Array(readFileSync(zipFile)),\n\t\t\t\t},\n\t\t\t\tFunctionName: functionName,\n\t\t\t\tHandler: 'index.handler',\n\t\t\t\tRole: customRoleArn ?? defaultRoleName,\n\t\t\t\tRuntime: 'nodejs24.x',","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/api/create-function.ts#L130-L166","documentation":"When deploying a Lambda function with deployFunction() or createFunction(), if enableLambdaInsights is true but the selected AWS region does not have a corresponding Lambda Insights extension ARN in the lambdaInsightsExtensions map, Remotion throws this error. AWS does not publish the CloudWatch Lambda Insights extension layer in every region, so Remotion maintains a region-to-layer-ARN table and refuses to deploy rather than silently skipping insights.","triggerScenarios":"Calling deployFunction({enableLambdaInsights: true, region: '<unsupported-region>', ...}) or createFunction() with the same combination, where the region is not in the lambdaInsightsExtensions table (i.e., the entry is null). This includes regions like some opt-in or newer regions where AWS has not published the insights layer.","commonSituations":"Enabling Lambda Insights globally in a config that is reused across multiple regions; deploying to a region that was added after the lambdaInsightsExtensions table was last updated; using an opt-in region (e.g. ap-east-1, me-south-1, af-south-1) where the layer is unavailable.","solutions":["Set enableLambdaInsights: false (or omit it) when deploying to the unsupported region.","Switch to a region that supports Lambda Insights — check the supported regions list at the docs URL in the error message.","If you need insights in that region, consider using CloudWatch metrics or a custom monitoring layer instead."],"exampleFix":"// before\nawait deployFunction({\n  region: 'af-south-1',\n  enableLambdaInsights: true, // not supported here\n  // ...\n});\n\n// after\nawait deployFunction({\n  region: 'af-south-1',\n  enableLambdaInsights: false,\n  // ...\n});","handlingStrategy":"validation","validationCode":"import {lambdaInsightsExtensions} from '@remotion/lambda'; // or shared module\n\nfunction isLambdaInsightsSupported(region: string): boolean {\n  // Check the public supported regions list from the docs\n  const supported = new Set([\n    'ap-northeast-1','ap-northeast-2','ap-south-1','ap-southeast-1','ap-southeast-2',\n    'ca-central-1','eu-central-1','eu-north-1','eu-west-1','eu-west-2','eu-west-3',\n    'sa-east-1','us-east-1','us-east-2','us-west-1','us-west-2',\n  ]);\n  return supported.has(region);\n}\n\nconst enableInsights = isLambdaInsightsSupported(region) && userWantsInsights;","typeGuard":"function supportsLambdaInsights(region: string): boolean {\n  try {\n    return Boolean((lambdaInsightsExtensions as Record<string, string | null>)[region]);\n  } catch {\n    return false;\n  }\n}","tryCatchPattern":"try {\n  await deployFunction({region, enableLambdaInsights: true, ...});\n} catch (err) {\n  if (err instanceof Error && err.message.includes('Lambda Insights is not supported')) {\n    // Retry without insights for this region\n    await deployFunction({region, enableLambdaInsights: false, ...});\n  } else {\n    throw err;\n  }\n}","preventionTips":["Check the supported regions list before enabling Lambda Insights.","Make enableLambdaInsights region-dependent in deployment scripts rather than hardcoding true.","Keep the lambdaInsightsExtensions table in sync with AWS updates."],"tags":["lambda","aws","region","lambda-insights","configuration","deployment"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}