remotion-dev/remotion · error · Error

Lambda Insights is not supported by AWS in region ${region}.

Error message

Lambda Insights is not supported by AWS in region ${region}. Please disable Lambda Insights. See http://remotion.dev/docs/lambda/insights#unsupported-regions

What it means

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.

Source

Thrown at packages/lambda/src/api/create-function.ts:148

	let vpcConfig: VpcConfig | undefined;
	if (vpcSubnetIds && vpcSecurityGroupIds) {
		vpcConfig = {
			SubnetIds: vpcSubnetIds.split(','),
			SecurityGroupIds: vpcSecurityGroupIds.split(','),
		};
	}

	RenderInternals.Log.verbose(
		{indent: false, logLevel},
		'Deploying new Lambda function',
	);

	const insightsLayer = enableLambdaInsights
		? lambdaInsightsExtensions[region]
		: null;
	if (enableLambdaInsights && !insightsLayer) {
		throw new Error(
			`Lambda Insights is not supported by AWS in region ${region}. Please disable Lambda Insights. See http://remotion.dev/docs/lambda/insights#unsupported-regions`,
		);
	}

	const {FunctionName, FunctionArn} =
		await LambdaClientInternals.getLambdaClient(
			region,
			undefined,
			requestHandler,
		).send(
			new CreateFunctionCommand({
				Code: {
					ZipFile: new Uint8Array(readFileSync(zipFile)),
				},
				FunctionName: functionName,
				Handler: 'index.handler',
				Role: customRoleArn ?? defaultRoleName,
				Runtime: 'nodejs24.x',

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Set enableLambdaInsights: false (or omit it) when deploying to the unsupported region.
  2. Switch to a region that supports Lambda Insights — check the supported regions list at the docs URL in the error message.
  3. If you need insights in that region, consider using CloudWatch metrics or a custom monitoring layer instead.

Example fix

// before
await deployFunction({
  region: 'af-south-1',
  enableLambdaInsights: true, // not supported here
  // ...
});

// after
await deployFunction({
  region: 'af-south-1',
  enableLambdaInsights: false,
  // ...
});
Defensive patterns

Strategy: validation

Validate before calling

import {lambdaInsightsExtensions} from '@remotion/lambda'; // or shared module

function isLambdaInsightsSupported(region: string): boolean {
  // Check the public supported regions list from the docs
  const supported = new Set([
    'ap-northeast-1','ap-northeast-2','ap-south-1','ap-southeast-1','ap-southeast-2',
    'ca-central-1','eu-central-1','eu-north-1','eu-west-1','eu-west-2','eu-west-3',
    'sa-east-1','us-east-1','us-east-2','us-west-1','us-west-2',
  ]);
  return supported.has(region);
}

const enableInsights = isLambdaInsightsSupported(region) && userWantsInsights;

Type guard

function supportsLambdaInsights(region: string): boolean {
  try {
    return Boolean((lambdaInsightsExtensions as Record<string, string | null>)[region]);
  } catch {
    return false;
  }
}

Try / catch

try {
  await deployFunction({region, enableLambdaInsights: true, ...});
} catch (err) {
  if (err instanceof Error && err.message.includes('Lambda Insights is not supported')) {
    // Retry without insights for this region
    await deployFunction({region, enableLambdaInsights: false, ...});
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/555909a881df5bde. Report an issue: GitHub.