{"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":124,"sourceCode":"\t\t\tregion,\n\t\t\trequestHandler,\n\t\t).send(\n\t\t\tnew PutRetentionPolicyCommand({\n\t\t\t\tlogGroupName: `${LOG_GROUP_PREFIX}${functionName}`,\n\t\t\t\tretentionInDays,\n\t\t\t}),\n\t\t);\n\t\tRenderInternals.Log.verbose(\n\t\t\t{indent: false, logLevel},\n\t\t\t`Set retention to ${retentionInDays} days`,\n\t\t);\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 layers = (\n\t\tcustomLayerArns ??\n\t\tgetLayers({\n\t\t\toption: runtimePreference,\n\t\t\tregion,\n\t\t}).map(({layerArn, version}) => `${layerArn}:${version}`)\n\t).concat(insightsLayer ? [insightsLayer] : []);\n\n\tif (alreadyCreated) {\n\t\tRenderInternals.Log.verbose(\n\t\t\t{indent: false, logLevel},\n\t\t\t`Function ${functionName} already existed`,\n\t\t);\n","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/remotion-dev/remotion/blob/10db9de07356446fb0edb3c3ae211369b693d18b/packages/lambda/src/api/create-function.ts#L106-L142","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":"10db9de07356446fb0edb3c3ae211369b693d18b","analyzedAt":"2026-08-22T21:45:17.748Z","contentChangedAt":"2026-08-22T21:45:17.748Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}