@remotion/lambda 4.0.508 → 4.0.510

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/admin/make-layer-public.js +6 -5
  2. package/dist/api/create-function.d.ts +2 -1
  3. package/dist/api/create-function.js +57 -20
  4. package/dist/api/deploy-function.d.ts +7 -2
  5. package/dist/api/deploy-function.js +10 -1
  6. package/dist/api/get-regions.d.ts +1 -1
  7. package/dist/api/iam-validation/resolve-caller-arn.d.ts +6 -0
  8. package/dist/api/iam-validation/resolve-caller-arn.js +28 -0
  9. package/dist/api/iam-validation/role-permissions.d.ts +5 -2
  10. package/dist/api/iam-validation/role-permissions.js +9 -7
  11. package/dist/api/iam-validation/simulate.js +8 -22
  12. package/dist/api/iam-validation/suggested-policy.d.ts +6 -2
  13. package/dist/api/iam-validation/suggested-policy.js +28 -26
  14. package/dist/api/iam-validation/user-permissions.d.ts +5 -2
  15. package/dist/api/iam-validation/user-permissions.js +14 -10
  16. package/dist/cli/args.d.ts +1 -0
  17. package/dist/cli/commands/functions/deploy.js +7 -0
  18. package/dist/cli/commands/policies/role.js +5 -1
  19. package/dist/cli/commands/policies/user.js +5 -1
  20. package/dist/cli/commands/quotas/increase.js +4 -2
  21. package/dist/cli/commands/quotas/list.js +2 -1
  22. package/dist/cli/commands/render/render.js +2 -2
  23. package/dist/cli/commands/still.js +2 -2
  24. package/dist/cli/get-aws-region.d.ts +1 -1
  25. package/dist/cli/helpers/get-s3-output-provider-from-cli.d.ts +1 -1
  26. package/dist/esm/index.mjs +274 -147
  27. package/dist/esm/policies.mjs +36 -38
  28. package/dist/functions/helpers/get-current-region.d.ts +1 -1
  29. package/dist/functions/helpers/make-aws-artifact.d.ts +1 -1
  30. package/dist/functions/helpers/make-aws-artifact.js +3 -1
  31. package/dist/index.d.ts +3 -2
  32. package/dist/shared/get-layers.d.ts +1 -1
  33. package/dist/shared/get-layers.js +4 -2
  34. package/dist/shared/hosted-layers.d.ts +2 -1
  35. package/dist/shared/lambda-insights-extensions.js +2 -0
  36. package/dist/shared/validate-custom-layer-arns.d.ts +6 -0
  37. package/dist/shared/validate-custom-layer-arns.js +44 -0
  38. package/package.json +12 -12
  39. package/remotionlambda-arm64.zip +0 -0
@@ -8604,7 +8604,7 @@ var require_package = __commonJS((exports, module) => {
8604
8604
  url: "https://github.com/remotion-dev/remotion/tree/main/packages/lambda"
8605
8605
  },
8606
8606
  name: "@remotion/lambda",
8607
- version: "4.0.508",
8607
+ version: "4.0.510",
8608
8608
  description: "Render Remotion videos on AWS Lambda",
8609
8609
  main: "dist/index.js",
8610
8610
  scripts: {
@@ -8778,7 +8778,7 @@ var deleteSite = (props) => {
8778
8778
 
8779
8779
  // src/api/deploy-function.ts
8780
8780
  import {
8781
- LambdaClientInternals as LambdaClientInternals5,
8781
+ LambdaClientInternals as LambdaClientInternals6,
8782
8782
  speculateFunctionName
8783
8783
  } from "@remotion/lambda-client";
8784
8784
  import { DEFAULT_EPHEMERAL_STORAGE_IN_MB } from "@remotion/lambda-client/constants";
@@ -8797,9 +8797,11 @@ import {
8797
8797
  import {
8798
8798
  CreateFunctionCommand,
8799
8799
  GetFunctionCommand,
8800
+ GetFunctionConfigurationCommand,
8800
8801
  PutFunctionEventInvokeConfigCommand,
8801
8802
  PutRuntimeManagementConfigCommand,
8802
- TagResourceCommand
8803
+ TagResourceCommand,
8804
+ UpdateFunctionConfigurationCommand
8803
8805
  } from "@aws-sdk/client-lambda";
8804
8806
  import {
8805
8807
  LambdaClientInternals as LambdaClientInternals3
@@ -9335,8 +9337,10 @@ var getLayers = ({
9335
9337
  option,
9336
9338
  region
9337
9339
  }) => {
9338
- const layers = hostedLayers[region];
9339
- return layers.filter((layer) => {
9340
+ if (!(region in hostedLayers)) {
9341
+ throw new Error(`Remotion-hosted Layers are not available in ${region}.`);
9342
+ }
9343
+ return hostedLayers[region].filter((layer) => {
9340
9344
  if (layer.layerArn.includes("emoji-apple")) {
9341
9345
  return option === "apple-emojis";
9342
9346
  }
@@ -9380,7 +9384,9 @@ var lambdaInsightsExtensions = {
9380
9384
  "sa-east-1": "arn:aws:lambda:sa-east-1:580247275435:layer:LambdaInsightsExtension-Arm64:3",
9381
9385
  "ap-southeast-4": null,
9382
9386
  "ap-southeast-5": null,
9383
- "eu-central-2": null
9387
+ "eu-central-2": null,
9388
+ "cn-north-1": "arn:aws-cn:lambda:cn-north-1:488211338238:layer:LambdaInsightsExtension-Arm64:4",
9389
+ "cn-northwest-1": "arn:aws-cn:lambda:cn-northwest-1:488211338238:layer:LambdaInsightsExtension-Arm64:4"
9384
9390
  };
9385
9391
 
9386
9392
  // src/api/iam-validation/role-permissions.ts
@@ -9390,7 +9396,7 @@ import {
9390
9396
  REMOTION_BUCKET_PREFIX,
9391
9397
  RENDER_FN_PREFIX
9392
9398
  } from "@remotion/lambda-client/constants";
9393
- var rolePermissions = [
9399
+ var getRolePermissions = (partition) => [
9394
9400
  {
9395
9401
  actions: ["s3:ListAllMyBuckets"],
9396
9402
  resource: ["*"]
@@ -9406,24 +9412,25 @@ var rolePermissions = [
9406
9412
  "s3:PutObject",
9407
9413
  "s3:GetBucketLocation"
9408
9414
  ],
9409
- resource: [`arn:aws:s3:::${REMOTION_BUCKET_PREFIX}*`]
9415
+ resource: [`arn:${partition}:s3:::${REMOTION_BUCKET_PREFIX}*`]
9410
9416
  },
9411
9417
  {
9412
9418
  actions: ["lambda:InvokeFunction"],
9413
- resource: [`arn:aws:lambda:*:*:function:${RENDER_FN_PREFIX}*`]
9419
+ resource: [`arn:${partition}:lambda:*:*:function:${RENDER_FN_PREFIX}*`]
9414
9420
  },
9415
9421
  {
9416
9422
  actions: ["logs:CreateLogGroup"],
9417
- resource: [`arn:aws:logs:*:*:log-group:${LAMBDA_INSIGHTS_PREFIX}`]
9423
+ resource: [`arn:${partition}:logs:*:*:log-group:${LAMBDA_INSIGHTS_PREFIX}`]
9418
9424
  },
9419
9425
  {
9420
9426
  actions: ["logs:CreateLogStream", "logs:PutLogEvents"],
9421
9427
  resource: [
9422
- `arn:aws:logs:*:*:log-group:${LOG_GROUP_PREFIX}${RENDER_FN_PREFIX}*`,
9423
- `arn:aws:logs:*:*:log-group:${LAMBDA_INSIGHTS_PREFIX}:*`
9428
+ `arn:${partition}:logs:*:*:log-group:${LOG_GROUP_PREFIX}${RENDER_FN_PREFIX}*`,
9429
+ `arn:${partition}:logs:*:*:log-group:${LAMBDA_INSIGHTS_PREFIX}:*`
9424
9430
  ]
9425
9431
  }
9426
9432
  ];
9433
+ var rolePermissions = getRolePermissions("aws");
9427
9434
 
9428
9435
  // src/api/iam-validation/user-permissions.ts
9429
9436
  import {
@@ -9431,7 +9438,7 @@ import {
9431
9438
  REMOTION_BUCKET_PREFIX as REMOTION_BUCKET_PREFIX2,
9432
9439
  RENDER_FN_PREFIX as RENDER_FN_PREFIX2
9433
9440
  } from "@remotion/lambda-client/constants";
9434
- var requiredPermissions = [
9441
+ var getRequiredPermissions = (partition) => [
9435
9442
  {
9436
9443
  id: "HandleQuotas",
9437
9444
  actions: [
@@ -9450,7 +9457,7 @@ var requiredPermissions = [
9450
9457
  {
9451
9458
  id: "LambdaInvokation",
9452
9459
  actions: ["iam:PassRole"],
9453
- resource: ["arn:aws:iam::*:role/remotion-lambda-role"]
9460
+ resource: [`arn:${partition}:iam::*:role/remotion-lambda-role`]
9454
9461
  },
9455
9462
  {
9456
9463
  id: "Storage",
@@ -9469,7 +9476,7 @@ var requiredPermissions = [
9469
9476
  "s3:PutBucketPolicy",
9470
9477
  "s3:PutLifecycleConfiguration"
9471
9478
  ],
9472
- resource: [`arn:aws:s3:::${REMOTION_BUCKET_PREFIX2}*`]
9479
+ resource: [`arn:${partition}:s3:::${REMOTION_BUCKET_PREFIX2}*`]
9473
9480
  },
9474
9481
  {
9475
9482
  id: "BucketListing",
@@ -9492,55 +9499,52 @@ var requiredPermissions = [
9492
9499
  "lambda:PutRuntimeManagementConfig",
9493
9500
  "lambda:TagResource"
9494
9501
  ],
9495
- resource: [`arn:aws:lambda:*:*:function:${RENDER_FN_PREFIX2}*`]
9502
+ resource: [`arn:${partition}:lambda:*:*:function:${RENDER_FN_PREFIX2}*`]
9496
9503
  },
9497
9504
  {
9498
9505
  id: "LogsRetention",
9499
9506
  actions: ["logs:CreateLogGroup", "logs:PutRetentionPolicy"],
9500
9507
  resource: [
9501
- `arn:aws:logs:*:*:log-group:${LOG_GROUP_PREFIX2}${RENDER_FN_PREFIX2}*`
9508
+ `arn:${partition}:logs:*:*:log-group:${LOG_GROUP_PREFIX2}${RENDER_FN_PREFIX2}*`
9502
9509
  ]
9503
9510
  },
9504
9511
  {
9505
9512
  id: "FetchBinaries",
9506
9513
  actions: ["lambda:GetLayerVersion"],
9507
- resource: [
9514
+ resource: partition === "aws-cn" ? ["arn:aws-cn:lambda:*:488211338238:layer:LambdaInsightsExtension*"] : [
9508
9515
  REMOTION_HOSTED_LAYER_ARN,
9509
9516
  "arn:aws:lambda:*:580247275435:layer:LambdaInsightsExtension*"
9510
9517
  ]
9511
9518
  }
9512
9519
  ];
9520
+ var requiredPermissions = getRequiredPermissions("aws");
9513
9521
 
9514
9522
  // src/api/iam-validation/suggested-policy.ts
9515
- var suggestedPolicy = {
9523
+ var makePolicy = (partition) => ({
9516
9524
  Version: "2012-10-17",
9517
- Statement: [
9518
- ...requiredPermissions.map((per) => {
9519
- return {
9520
- Sid: per.id,
9521
- Effect: "Allow",
9522
- Action: per.actions,
9523
- Resource: per.resource
9524
- };
9525
- })
9526
- ]
9527
- };
9528
- var suggestedRolePolicy = {
9525
+ Statement: getRequiredPermissions(partition).map((per) => {
9526
+ return {
9527
+ Sid: per.id,
9528
+ Effect: "Allow",
9529
+ Action: per.actions,
9530
+ Resource: per.resource
9531
+ };
9532
+ })
9533
+ });
9534
+ var makeRolePolicy = (partition) => ({
9529
9535
  Version: "2012-10-17",
9530
- Statement: [
9531
- ...rolePermissions.map((per, i) => {
9532
- return {
9533
- Sid: String(i),
9534
- Effect: "Allow",
9535
- Action: per.actions,
9536
- Resource: per.resource
9537
- };
9538
- })
9539
- ]
9540
- };
9541
- var getUserPolicy = () => JSON.stringify(suggestedPolicy, null, 2);
9536
+ Statement: getRolePermissions(partition).map((per, i) => {
9537
+ return {
9538
+ Sid: String(i),
9539
+ Effect: "Allow",
9540
+ Action: per.actions,
9541
+ Resource: per.resource
9542
+ };
9543
+ })
9544
+ });
9545
+ var getUserPolicy = (options) => JSON.stringify(makePolicy(options?.partition ?? "aws"), null, 2);
9542
9546
  var ROLE_NAME = "remotion-lambda-role";
9543
- var getRolePolicy = () => JSON.stringify(suggestedRolePolicy, null, 2);
9547
+ var getRolePolicy = (options) => JSON.stringify(makeRolePolicy(options?.partition ?? "aws"), null, 2);
9544
9548
 
9545
9549
  // src/api/create-function.ts
9546
9550
  var createFunction = async ({
@@ -9555,6 +9559,7 @@ var createFunction = async ({
9555
9559
  retentionInDays,
9556
9560
  ephemerealStorageInMb,
9557
9561
  customRoleArn,
9562
+ customLayerArns,
9558
9563
  enableLambdaInsights,
9559
9564
  logLevel,
9560
9565
  vpcSubnetIds,
@@ -9584,15 +9589,47 @@ var createFunction = async ({
9584
9589
  }));
9585
9590
  RenderInternals.Log.verbose({ indent: false, logLevel }, `Set retention to ${retentionInDays} days`);
9586
9591
  }
9592
+ const insightsLayer = enableLambdaInsights ? lambdaInsightsExtensions[region] : null;
9593
+ if (enableLambdaInsights && !insightsLayer) {
9594
+ 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`);
9595
+ }
9596
+ const layers = (customLayerArns ?? getLayers({
9597
+ option: runtimePreference,
9598
+ region
9599
+ }).map(({ layerArn, version }) => `${layerArn}:${version}`)).concat(insightsLayer ? [insightsLayer] : []);
9587
9600
  if (alreadyCreated) {
9588
9601
  RenderInternals.Log.verbose({ indent: false, logLevel }, `Function ${functionName} already existed`);
9602
+ if (customLayerArns === null) {
9603
+ return { FunctionName: functionName };
9604
+ }
9605
+ const lambdaClient = LambdaClientInternals3.getLambdaClient(region, undefined, requestHandler);
9606
+ const currentConfiguration = await lambdaClient.send(new GetFunctionConfigurationCommand({ FunctionName: functionName }));
9607
+ const currentLayers = (currentConfiguration.Layers ?? []).map((layer) => layer.Arn);
9608
+ const layersAreEqual = currentLayers.length === layers.length && currentLayers.every((layer, index) => layer === layers[index]);
9609
+ if (layersAreEqual) {
9610
+ return { FunctionName: functionName };
9611
+ }
9612
+ RenderInternals.Log.verbose({ indent: false, logLevel }, `Updating Layers for function ${functionName}`);
9613
+ await lambdaClient.send(new UpdateFunctionConfigurationCommand({
9614
+ FunctionName: functionName,
9615
+ Layers: layers
9616
+ }));
9617
+ while (true) {
9618
+ const configuration = await lambdaClient.send(new GetFunctionConfigurationCommand({ FunctionName: functionName }));
9619
+ if (configuration.State === "Failed" || configuration.LastUpdateStatus === "Failed") {
9620
+ throw new Error(`Failed to update Layers for function ${functionName}: ${configuration.StateReason ?? configuration.LastUpdateStatusReason ?? "Unknown reason"}`);
9621
+ }
9622
+ if (configuration.State === "Active" && configuration.LastUpdateStatus !== "InProgress") {
9623
+ break;
9624
+ }
9625
+ await new Promise((resolve) => {
9626
+ setTimeout(resolve, 1000);
9627
+ });
9628
+ }
9589
9629
  return { FunctionName: functionName };
9590
9630
  }
9591
- const defaultRoleName = `arn:aws:iam::${accountId}:role/${ROLE_NAME}`;
9592
- const layers = getLayers({
9593
- option: runtimePreference,
9594
- region
9595
- });
9631
+ const { partition } = LambdaClientInternals3.getAwsRegionMetadata(region);
9632
+ const defaultRoleName = `arn:${partition}:iam::${accountId}:role/${ROLE_NAME}`;
9596
9633
  let vpcConfig;
9597
9634
  if (vpcSubnetIds && vpcSecurityGroupIds) {
9598
9635
  vpcConfig = {
@@ -9601,10 +9638,6 @@ var createFunction = async ({
9601
9638
  };
9602
9639
  }
9603
9640
  RenderInternals.Log.verbose({ indent: false, logLevel }, "Deploying new Lambda function");
9604
- const insightsLayer = enableLambdaInsights ? lambdaInsightsExtensions[region] : null;
9605
- if (enableLambdaInsights && !insightsLayer) {
9606
- 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`);
9607
- }
9608
9641
  const { FunctionName, FunctionArn } = await LambdaClientInternals3.getLambdaClient(region, undefined, requestHandler).send(new CreateFunctionCommand({
9609
9642
  Code: {
9610
9643
  ZipFile: new Uint8Array(readFileSync(zipFile))
@@ -9616,7 +9649,7 @@ var createFunction = async ({
9616
9649
  Description: "Renders a Remotion video.",
9617
9650
  MemorySize: memorySizeInMb,
9618
9651
  Timeout: timeoutInSeconds,
9619
- Layers: layers.map(({ layerArn, version }) => `${layerArn}:${version}`).concat(insightsLayer ? [insightsLayer] : []),
9652
+ Layers: layers,
9620
9653
  Architectures: ["arm64"],
9621
9654
  EphemeralStorage: {
9622
9655
  Size: ephemerealStorageInMb
@@ -9650,6 +9683,7 @@ var createFunction = async ({
9650
9683
  RenderInternals.Log.verbose({ indent: false, logLevel }, "Set function retries to 0.");
9651
9684
  RenderInternals.Log.verbose({ indent: false, logLevel }, "Waiting for the function to be ready...");
9652
9685
  let state = "Pending";
9686
+ let currentRuntimeVersionArn = null;
9653
9687
  while (state === "Pending") {
9654
9688
  const getFn = await LambdaClientInternals3.getLambdaClient(region, undefined, requestHandler).send(new GetFunctionCommand({
9655
9689
  FunctionName
@@ -9658,20 +9692,24 @@ var createFunction = async ({
9658
9692
  setTimeout(() => resolve(), 1000);
9659
9693
  });
9660
9694
  state = getFn.Configuration?.State;
9695
+ currentRuntimeVersionArn = getFn.Configuration?.RuntimeVersionConfig?.RuntimeVersionArn ?? null;
9661
9696
  }
9662
9697
  RenderInternals.Log.verbose({ indent: false, logLevel }, "Function is now ready.");
9663
9698
  RenderInternals.Log.verbose({ indent: false, logLevel }, "Locking the runtime version of the function...");
9664
- const RuntimeVersionArn = `arn:aws:lambda:${region}::runtime:58a37e8413ed69058c4ac3b1df642118591f17d40def93d6101f867c72cd03c2`;
9699
+ const runtimeVersionArn = partition === "aws-cn" ? currentRuntimeVersionArn : `arn:aws:lambda:${region}::runtime:58a37e8413ed69058c4ac3b1df642118591f17d40def93d6101f867c72cd03c2`;
9665
9700
  try {
9701
+ if (!runtimeVersionArn) {
9702
+ throw new Error("AWS did not return a runtime version ARN.");
9703
+ }
9666
9704
  await LambdaClientInternals3.getLambdaClient(region, undefined, requestHandler).send(new PutRuntimeManagementConfigCommand({
9667
9705
  FunctionName,
9668
9706
  UpdateRuntimeOn: "Manual",
9669
- RuntimeVersionArn
9707
+ RuntimeVersionArn: runtimeVersionArn
9670
9708
  }));
9709
+ RenderInternals.Log.verbose({ indent: false, logLevel }, `Function runtime is locked to ${runtimeVersionArn}`);
9671
9710
  } catch {
9672
9711
  console.warn("⚠️ Could not lock the runtime version. We recommend to update your policies to prevent your functions from breaking in the future in case the AWS runtime changes. See https://remotion.dev/docs/lambda/feb-2023-incident for an example on how to update your policy.");
9673
9712
  }
9674
- RenderInternals.Log.verbose({ indent: false, logLevel }, `Function runtime is locked to ${RuntimeVersionArn}`);
9675
9713
  return { FunctionName };
9676
9714
  };
9677
9715
 
@@ -9896,6 +9934,55 @@ var b = "../";
9896
9934
  var a = "remotionlambda-arm64.zip";
9897
9935
  var FUNCTION_ZIP_ARM64 = path4.resolve(__require.resolve(`../` + b), "..", "..", a);
9898
9936
 
9937
+ // src/shared/validate-custom-layer-arns.ts
9938
+ import {
9939
+ LambdaClientInternals as LambdaClientInternals5
9940
+ } from "@remotion/lambda-client";
9941
+ var layerVersionArnRegex = /^arn:([a-z0-9][a-z0-9-]*):lambda:([a-z0-9-]+):(\d{12}):layer:([A-Za-z0-9-_]+):(\d+)$/;
9942
+ var validateCustomLayerArns = ({
9943
+ customLayerArns,
9944
+ enableLambdaInsights,
9945
+ region,
9946
+ runtimePreference
9947
+ }) => {
9948
+ const { partition } = LambdaClientInternals5.getAwsRegionMetadata(region);
9949
+ if (customLayerArns === null) {
9950
+ if (partition === "aws-cn") {
9951
+ throw new Error("customLayerArns must be specified when deploying to AWS China regions because Remotion-hosted Layers are not available in the aws-cn partition.");
9952
+ }
9953
+ return;
9954
+ }
9955
+ if (!Array.isArray(customLayerArns) || customLayerArns.length === 0) {
9956
+ throw new TypeError("customLayerArns must contain at least one Layer ARN.");
9957
+ }
9958
+ if (runtimePreference !== "default") {
9959
+ throw new Error("customLayerArns cannot be combined with a non-default runtimePreference.");
9960
+ }
9961
+ if (customLayerArns.length + (enableLambdaInsights ? 1 : 0) > 5) {
9962
+ throw new Error("Lambda functions support at most 5 Layers, including the Lambda Insights Layer.");
9963
+ }
9964
+ const seen = new Set;
9965
+ for (const layerArn of customLayerArns) {
9966
+ if (typeof layerArn !== "string" || layerArn.length === 0) {
9967
+ throw new TypeError("Each customLayerArns entry must be a non-empty string.");
9968
+ }
9969
+ const match = layerArn.match(layerVersionArnRegex);
9970
+ if (!match) {
9971
+ throw new TypeError(`Invalid Lambda Layer version ARN: ${layerArn}. Expected arn:<partition>:lambda:<region>:<12-digit-account-id>:layer:<layer-name>:<numeric-version>.`);
9972
+ }
9973
+ if (match[1] !== partition) {
9974
+ throw new Error(`The custom Layer ARN ${layerArn} uses partition ${match[1]}, but region ${region} uses partition ${partition}.`);
9975
+ }
9976
+ if (match[2] !== region) {
9977
+ throw new Error(`The custom Layer ARN ${layerArn} is in region ${match[2]}, but the function is being deployed to ${region}.`);
9978
+ }
9979
+ if (seen.has(layerArn)) {
9980
+ throw new Error(`Duplicate custom Layer ARN: ${layerArn}.`);
9981
+ }
9982
+ seen.add(layerArn);
9983
+ }
9984
+ };
9985
+
9899
9986
  // src/shared/validate-custom-role-arn.ts
9900
9987
  var validateCustomRoleArn = (customRoleArn) => {
9901
9988
  if (typeof customRoleArn !== "undefined" && typeof customRoleArn !== "string") {
@@ -9952,13 +10039,19 @@ var validateTimeout = (timeoutInSeconds) => {
9952
10039
 
9953
10040
  // src/api/deploy-function.ts
9954
10041
  var internalDeployFunction = async (params) => {
9955
- LambdaClientInternals5.validateMemorySize(params.memorySizeInMb);
10042
+ LambdaClientInternals6.validateMemorySize(params.memorySizeInMb);
9956
10043
  validateTimeout(params.timeoutInSeconds);
9957
- LambdaClientInternals5.validateAwsRegion(params.region);
10044
+ LambdaClientInternals6.validateAwsRegion(params.region);
9958
10045
  validateCloudWatchRetentionPeriod(params.cloudWatchLogRetentionPeriodInDays);
9959
- LambdaClientInternals5.validateDiskSizeInMb(params.diskSizeInMb);
10046
+ LambdaClientInternals6.validateDiskSizeInMb(params.diskSizeInMb);
9960
10047
  validateCustomRoleArn(params.customRoleArn);
9961
10048
  validateRuntimePreference(params.runtimePreference);
10049
+ validateCustomLayerArns({
10050
+ customLayerArns: params.customLayerArns,
10051
+ enableLambdaInsights: params.enableLambdaInsights,
10052
+ region: params.region,
10053
+ runtimePreference: params.runtimePreference
10054
+ });
9962
10055
  const functionName = speculateFunctionName({
9963
10056
  diskSizeInMb: params.diskSizeInMb,
9964
10057
  memorySizeInMb: params.memorySizeInMb,
@@ -9980,10 +10073,11 @@ var internalDeployFunction = async (params) => {
9980
10073
  accountId,
9981
10074
  memorySizeInMb: params.memorySizeInMb,
9982
10075
  timeoutInSeconds: params.timeoutInSeconds,
9983
- retentionInDays: params.cloudWatchLogRetentionPeriodInDays ?? LambdaClientInternals5.DEFAULT_CLOUDWATCH_RETENTION_PERIOD,
10076
+ retentionInDays: params.cloudWatchLogRetentionPeriodInDays ?? LambdaClientInternals6.DEFAULT_CLOUDWATCH_RETENTION_PERIOD,
9984
10077
  alreadyCreated: Boolean(alreadyDeployed),
9985
10078
  ephemerealStorageInMb: params.diskSizeInMb,
9986
10079
  customRoleArn: params.customRoleArn,
10080
+ customLayerArns: params.customLayerArns,
9987
10081
  enableLambdaInsights: params.enableLambdaInsights ?? false,
9988
10082
  logLevel: params.logLevel,
9989
10083
  vpcSubnetIds: params.vpcSubnetIds,
@@ -10007,6 +10101,7 @@ var deployFunction = ({
10007
10101
  timeoutInSeconds,
10008
10102
  cloudWatchLogRetentionPeriodInDays,
10009
10103
  customRoleArn,
10104
+ customLayerArns,
10010
10105
  enableLambdaInsights,
10011
10106
  indent,
10012
10107
  logLevel,
@@ -10025,6 +10120,7 @@ var deployFunction = ({
10025
10120
  logLevel: logLevel ?? "info",
10026
10121
  createCloudWatchLogGroup,
10027
10122
  customRoleArn: customRoleArn ?? undefined,
10123
+ customLayerArns: customLayerArns ?? null,
10028
10124
  diskSizeInMb: diskSizeInMb ?? DEFAULT_EPHEMERAL_STORAGE_IN_MB,
10029
10125
  enableLambdaInsights: enableLambdaInsights ?? false,
10030
10126
  memorySizeInMb,
@@ -10034,7 +10130,7 @@ var deployFunction = ({
10034
10130
  vpcSubnetIds,
10035
10131
  vpcSecurityGroupIds,
10036
10132
  runtimePreference: runtimePreference ?? "default",
10037
- providerSpecifics: LambdaClientInternals5.awsImplementation,
10133
+ providerSpecifics: LambdaClientInternals6.awsImplementation,
10038
10134
  fullClientSpecifics: awsFullClientSpecifics,
10039
10135
  requestHandler
10040
10136
  });
@@ -10042,12 +10138,12 @@ var deployFunction = ({
10042
10138
 
10043
10139
  // src/api/deploy-site.ts
10044
10140
  import fs4 from "node:fs";
10045
- import { LambdaClientInternals as LambdaClientInternals7 } from "@remotion/lambda-client";
10141
+ import { LambdaClientInternals as LambdaClientInternals8 } from "@remotion/lambda-client";
10046
10142
  import { getSitesKey as getSitesKey3 } from "@remotion/lambda-client/constants";
10047
10143
  import { wrapWithErrorHandling as wrapWithErrorHandling2 } from "@remotion/renderer/error-handling";
10048
10144
 
10049
10145
  // src/shared/deploy-site-with-bundle.ts
10050
- import { LambdaClientInternals as LambdaClientInternals6 } from "@remotion/lambda-client";
10146
+ import { LambdaClientInternals as LambdaClientInternals7 } from "@remotion/lambda-client";
10051
10147
  import {
10052
10148
  getSitesKey as getSitesKey2,
10053
10149
  REMOTION_BUCKET_PREFIX as REMOTION_BUCKET_PREFIX3
@@ -10142,7 +10238,7 @@ var deploySiteWithBundle = async ({
10142
10238
  requestHandler,
10143
10239
  getBundle
10144
10240
  }) => {
10145
- LambdaClientInternals6.validateAwsRegion(region);
10241
+ LambdaClientInternals7.validateAwsRegion(region);
10146
10242
  validateBucketName({
10147
10243
  bucketName,
10148
10244
  bucketNamePrefix: REMOTION_BUCKET_PREFIX3,
@@ -10216,7 +10312,7 @@ var deploySiteWithBundle = async ({
10216
10312
  };
10217
10313
  await upload(assetsToUpload);
10218
10314
  await upload(indexHtmlToUpload);
10219
- const limit2 = LambdaClientInternals6.pLimit(deleteConcurrency);
10315
+ const limit2 = LambdaClientInternals7.pLimit(deleteConcurrency);
10220
10316
  const deletePromises = toDelete.map((d) => {
10221
10317
  return limit2(() => {
10222
10318
  return providerSpecifics.deleteFile({
@@ -10231,7 +10327,7 @@ var deploySiteWithBundle = async ({
10231
10327
  });
10232
10328
  await waitForPromisesToFinish(deletePromises);
10233
10329
  return {
10234
- serveUrl: LambdaClientInternals6.makeS3ServeUrl({
10330
+ serveUrl: LambdaClientInternals7.makeS3ServeUrl({
10235
10331
  bucketName,
10236
10332
  subFolder,
10237
10333
  region
@@ -10350,11 +10446,11 @@ var deploySite = (args) => {
10350
10446
  gitSource: args.gitSource ?? null,
10351
10447
  options: args.options ?? {},
10352
10448
  privacy: args.privacy ?? "public",
10353
- siteName: args.siteName ?? LambdaClientInternals7.awsImplementation.randomHash(),
10449
+ siteName: args.siteName ?? LambdaClientInternals8.awsImplementation.randomHash(),
10354
10450
  indent: false,
10355
10451
  logLevel: "info",
10356
10452
  throwIfSiteExists: args.throwIfSiteExists ?? false,
10357
- providerSpecifics: LambdaClientInternals7.awsImplementation,
10453
+ providerSpecifics: LambdaClientInternals8.awsImplementation,
10358
10454
  forcePathStyle: args.forcePathStyle ?? false,
10359
10455
  fullClientSpecifics: awsFullClientSpecifics,
10360
10456
  requestHandler: args.requestHandler ?? null
@@ -10362,7 +10458,7 @@ var deploySite = (args) => {
10362
10458
  };
10363
10459
 
10364
10460
  // src/api/deploy-site-from-bundle.ts
10365
- import { LambdaClientInternals as LambdaClientInternals8 } from "@remotion/lambda-client";
10461
+ import { LambdaClientInternals as LambdaClientInternals9 } from "@remotion/lambda-client";
10366
10462
  import { wrapWithErrorHandling as wrapWithErrorHandling3 } from "@remotion/renderer/error-handling";
10367
10463
 
10368
10464
  // src/shared/validate-bundle-dir.ts
@@ -10458,11 +10554,11 @@ var deploySiteFromBundle = (args) => {
10458
10554
  region: args.region,
10459
10555
  options: args.options ?? {},
10460
10556
  privacy: args.privacy ?? "public",
10461
- siteName: args.siteName ?? LambdaClientInternals8.awsImplementation.randomHash(),
10557
+ siteName: args.siteName ?? LambdaClientInternals9.awsImplementation.randomHash(),
10462
10558
  indent: false,
10463
10559
  logLevel: args.logLevel ?? "info",
10464
10560
  throwIfSiteExists: args.throwIfSiteExists ?? false,
10465
- providerSpecifics: LambdaClientInternals8.awsImplementation,
10561
+ providerSpecifics: LambdaClientInternals9.awsImplementation,
10466
10562
  forcePathStyle: args.forcePathStyle ?? false,
10467
10563
  fullClientSpecifics: awsFullClientSpecifics,
10468
10564
  requestHandler: args.requestHandler ?? null
@@ -10471,7 +10567,7 @@ var deploySiteFromBundle = (args) => {
10471
10567
 
10472
10568
  // src/api/download-media.ts
10473
10569
  import path6 from "node:path";
10474
- import { LambdaClientInternals as LambdaClientInternals10 } from "@remotion/lambda-client";
10570
+ import { LambdaClientInternals as LambdaClientInternals11 } from "@remotion/lambda-client";
10475
10571
  import { REMOTION_BUCKET_PREFIX as REMOTION_BUCKET_PREFIX4 } from "@remotion/lambda-client/constants";
10476
10572
  import { RenderInternals as RenderInternals3 } from "@remotion/renderer";
10477
10573
  import {
@@ -10482,7 +10578,7 @@ import {
10482
10578
  // src/functions/helpers/read-with-progress.ts
10483
10579
  import { GetObjectCommand } from "@aws-sdk/client-s3";
10484
10580
  import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
10485
- import { LambdaClientInternals as LambdaClientInternals9 } from "@remotion/lambda-client";
10581
+ import { LambdaClientInternals as LambdaClientInternals10 } from "@remotion/lambda-client";
10486
10582
  import { RenderInternals as RenderInternals2 } from "@remotion/renderer";
10487
10583
  var lambdaDownloadFileWithProgress = async ({
10488
10584
  bucketName,
@@ -10497,7 +10593,7 @@ var lambdaDownloadFileWithProgress = async ({
10497
10593
  requestHandler,
10498
10594
  abortSignal
10499
10595
  }) => {
10500
- const client = LambdaClientInternals9.getS3Client({
10596
+ const client = LambdaClientInternals10.getS3Client({
10501
10597
  region,
10502
10598
  customCredentials,
10503
10599
  forcePathStyle,
@@ -10574,7 +10670,7 @@ var internalDownloadMedia = async (input) => {
10574
10670
  var downloadMedia = (input) => {
10575
10671
  return internalDownloadMedia({
10576
10672
  ...input,
10577
- providerSpecifics: LambdaClientInternals10.awsImplementation,
10673
+ providerSpecifics: LambdaClientInternals11.awsImplementation,
10578
10674
  forcePathStyle: false,
10579
10675
  onProgress: input.onProgress ?? (() => {
10580
10676
  return;
@@ -10590,7 +10686,7 @@ var downloadMedia = (input) => {
10590
10686
  import { GetFunctionCommand as GetFunctionCommand2 } from "@aws-sdk/client-lambda";
10591
10687
  import {
10592
10688
  getFunctionVersion,
10593
- LambdaClientInternals as LambdaClientInternals11
10689
+ LambdaClientInternals as LambdaClientInternals12
10594
10690
  } from "@remotion/lambda-client";
10595
10691
  import { DEFAULT_EPHEMERAL_STORAGE_IN_MB as DEFAULT_EPHEMERAL_STORAGE_IN_MB2 } from "@remotion/lambda-client/constants";
10596
10692
  var getFunctionInfo = async ({
@@ -10599,9 +10695,9 @@ var getFunctionInfo = async ({
10599
10695
  logLevel,
10600
10696
  requestHandler
10601
10697
  }) => {
10602
- LambdaClientInternals11.validateAwsRegion(region);
10698
+ LambdaClientInternals12.validateAwsRegion(region);
10603
10699
  const [functionInfo, version] = await Promise.all([
10604
- LambdaClientInternals11.getLambdaClient(region, undefined, requestHandler).send(new GetFunctionCommand2({
10700
+ LambdaClientInternals12.getLambdaClient(region, undefined, requestHandler).send(new GetFunctionCommand2({
10605
10701
  FunctionName: functionName
10606
10702
  })),
10607
10703
  getFunctionVersion({
@@ -10621,14 +10717,14 @@ var getFunctionInfo = async ({
10621
10717
  };
10622
10718
 
10623
10719
  // src/api/get-or-create-bucket.ts
10624
- import { LambdaClientInternals as LambdaClientInternals12 } from "@remotion/lambda-client";
10720
+ import { LambdaClientInternals as LambdaClientInternals13 } from "@remotion/lambda-client";
10625
10721
  import { internalGetOrCreateBucket } from "@remotion/serverless";
10626
10722
  var getOrCreateBucket = (options) => {
10627
10723
  return internalGetOrCreateBucket({
10628
10724
  region: options.region,
10629
10725
  enableFolderExpiry: options.enableFolderExpiry ?? null,
10630
10726
  customCredentials: options.customCredentials ?? null,
10631
- providerSpecifics: LambdaClientInternals12.awsImplementation,
10727
+ providerSpecifics: LambdaClientInternals13.awsImplementation,
10632
10728
  forcePathStyle: false,
10633
10729
  skipPutAcl: false,
10634
10730
  requestHandler: options.requestHandler ?? null,
@@ -10648,14 +10744,44 @@ var getRegions = (options) => {
10648
10744
 
10649
10745
  // src/api/iam-validation/simulate.ts
10650
10746
  import { GetCallerIdentityCommand } from "@aws-sdk/client-sts";
10651
- import { LambdaClientInternals as LambdaClientInternals14 } from "@remotion/lambda-client";
10747
+ import { LambdaClientInternals as LambdaClientInternals15 } from "@remotion/lambda-client";
10748
+
10749
+ // src/api/iam-validation/resolve-caller-arn.ts
10750
+ var resolveCallerArnForSimulation = ({
10751
+ callerIdentityArn,
10752
+ region,
10753
+ regionPartition
10754
+ }) => {
10755
+ const components = callerIdentityArn.match(/^arn:([^:]+):([^:]+)::(\d+):([^/]+)(.*)$/);
10756
+ if (!components) {
10757
+ throw new Error("Unknown AWS Caller Identity ARN detected");
10758
+ }
10759
+ const callerPartition = components[1];
10760
+ if (callerPartition !== regionPartition) {
10761
+ throw new Error(`AWS Caller Identity partition ${callerPartition} does not match region ${region}, which uses partition ${regionPartition}.`);
10762
+ }
10763
+ const service = components[2];
10764
+ const accountId = components[3];
10765
+ const resourceType = components[4];
10766
+ if (service === "iam" && resourceType === "user") {
10767
+ return callerIdentityArn;
10768
+ }
10769
+ if (service === "sts" && resourceType === "assumed-role") {
10770
+ const assumedRoleComponents = components[5].match(/^\/([^/]+)\/(.*)$/);
10771
+ if (!assumedRoleComponents) {
10772
+ throw new Error("Unsupported AWS Caller Identity as Assumed-Role ARN detected");
10773
+ }
10774
+ return `arn:${callerPartition}:iam::${accountId}:role/${assumedRoleComponents[1]}`;
10775
+ }
10776
+ throw new Error("Unsupported AWS Caller Identity ARN detected");
10777
+ };
10652
10778
 
10653
10779
  // src/api/iam-validation/simulate-rule.ts
10654
10780
  import { SimulatePrincipalPolicyCommand } from "@aws-sdk/client-iam";
10655
- import { LambdaClientInternals as LambdaClientInternals13 } from "@remotion/lambda-client";
10781
+ import { LambdaClientInternals as LambdaClientInternals14 } from "@remotion/lambda-client";
10656
10782
  var simulateRule = async (options) => {
10657
10783
  try {
10658
- const res = await LambdaClientInternals13.getIamClient(options.region, options.requestHandler).send(new SimulatePrincipalPolicyCommand({
10784
+ const res = await LambdaClientInternals14.getIamClient(options.region, options.requestHandler).send(new SimulatePrincipalPolicyCommand({
10659
10785
  ActionNames: options.actionNames,
10660
10786
  PolicySourceArn: options.arn,
10661
10787
  ResourceArns: options.resource
@@ -10690,29 +10816,18 @@ var logPermissionOutput = (output) => {
10690
10816
  return [getEmojiForStatus(output.decision), output.name].join(" ");
10691
10817
  };
10692
10818
  var simulatePermissions = async (options) => {
10693
- const callerIdentity = await LambdaClientInternals14.getStsClient(options.region, options.requestHandler).send(new GetCallerIdentityCommand({}));
10819
+ const callerIdentity = await LambdaClientInternals15.getStsClient(options.region, options.requestHandler).send(new GetCallerIdentityCommand({}));
10694
10820
  if (!callerIdentity?.Arn) {
10695
10821
  throw new Error("No valid AWS Caller Identity detected");
10696
10822
  }
10697
- const callerIdentityArnComponents = callerIdentity.Arn.match(/arn:aws:([^:]+)::(\d+):([^/]+)(.*)/);
10698
- if (!callerIdentityArnComponents) {
10699
- throw new Error("Unknown AWS Caller Identity ARN detected");
10700
- }
10701
- const callerIdentityArnType = callerIdentityArnComponents[1];
10702
- let callerArn;
10703
- if (callerIdentityArnType === "iam" && callerIdentityArnComponents[3] === "user") {
10704
- callerArn = callerIdentity.Arn;
10705
- } else if (callerIdentityArnType === "sts" && callerIdentityArnComponents[3] === "assumed-role") {
10706
- const assumedRoleComponents = callerIdentityArnComponents[4].match(/\/([^/]+)\/(.*)/);
10707
- if (!assumedRoleComponents) {
10708
- throw new Error("Unsupported AWS Caller Identity as Assumed-Role ARN detected");
10709
- }
10710
- callerArn = `arn:aws:iam::${callerIdentityArnComponents[2]}:role/${assumedRoleComponents[1]}`;
10711
- } else {
10712
- throw new Error("Unsupported AWS Caller Identity ARN detected");
10713
- }
10823
+ const { partition: regionPartition } = LambdaClientInternals15.getAwsRegionMetadata(options.region);
10824
+ const callerArn = resolveCallerArnForSimulation({
10825
+ callerIdentityArn: callerIdentity.Arn,
10826
+ region: options.region,
10827
+ regionPartition
10828
+ });
10714
10829
  const results = [];
10715
- for (const per of requiredPermissions) {
10830
+ for (const per of getRequiredPermissions(regionPartition)) {
10716
10831
  const result = await simulateRule({
10717
10832
  actionNames: per.actions,
10718
10833
  arn: callerArn,
@@ -10731,7 +10846,7 @@ var simulatePermissions = async (options) => {
10731
10846
 
10732
10847
  // src/cli/index.ts
10733
10848
  import { CliInternals as CliInternals23 } from "@remotion/cli";
10734
- import { LambdaClientInternals as LambdaClientInternals24 } from "@remotion/lambda-client";
10849
+ import { LambdaClientInternals as LambdaClientInternals27 } from "@remotion/lambda-client";
10735
10850
  import { BINARY_NAME as BINARY_NAME14 } from "@remotion/lambda-client/constants";
10736
10851
  import { RenderInternals as RenderInternals7 } from "@remotion/renderer";
10737
10852
  import {
@@ -10762,29 +10877,29 @@ var forceFlagProvided = parsedLambdaCli.f || parsedLambdaCli.force || parsedLamb
10762
10877
  import { CliInternals as CliInternals8 } from "@remotion/cli";
10763
10878
  import {
10764
10879
  getCompositionsOnLambda,
10765
- LambdaClientInternals as LambdaClientInternals18
10880
+ LambdaClientInternals as LambdaClientInternals19
10766
10881
  } from "@remotion/lambda-client";
10767
10882
  import { BINARY_NAME as BINARY_NAME4 } from "@remotion/lambda-client/constants";
10768
10883
  import { BrowserSafeApis } from "@remotion/renderer/client";
10769
10884
 
10770
10885
  // src/cli/get-aws-region.ts
10771
- import { LambdaClientInternals as LambdaClientInternals15 } from "@remotion/lambda-client";
10886
+ import { LambdaClientInternals as LambdaClientInternals16 } from "@remotion/lambda-client";
10772
10887
  import { DEFAULT_REGION } from "@remotion/lambda-client/constants";
10773
10888
  var getAwsRegion = () => {
10774
10889
  if (parsedLambdaCli.region) {
10775
- LambdaClientInternals15.validateAwsRegion(parsedLambdaCli.region);
10890
+ LambdaClientInternals16.validateAwsRegion(parsedLambdaCli.region);
10776
10891
  return parsedLambdaCli.region;
10777
10892
  }
10778
- const envVariable = LambdaClientInternals15.getEnvVariable("REMOTION_AWS_REGION") ?? LambdaClientInternals15.getEnvVariable("AWS_REGION");
10893
+ const envVariable = LambdaClientInternals16.getEnvVariable("REMOTION_AWS_REGION") ?? LambdaClientInternals16.getEnvVariable("AWS_REGION");
10779
10894
  if (envVariable) {
10780
- LambdaClientInternals15.validateAwsRegion(envVariable);
10895
+ LambdaClientInternals16.validateAwsRegion(envVariable);
10781
10896
  return envVariable;
10782
10897
  }
10783
10898
  return DEFAULT_REGION;
10784
10899
  };
10785
10900
 
10786
10901
  // src/cli/helpers/find-function-name.ts
10787
- import { LambdaClientInternals as LambdaClientInternals17 } from "@remotion/lambda-client";
10902
+ import { LambdaClientInternals as LambdaClientInternals18 } from "@remotion/lambda-client";
10788
10903
  import { BINARY_NAME as BINARY_NAME3 } from "@remotion/lambda-client/constants";
10789
10904
  import { VERSION as VERSION4 } from "remotion/version";
10790
10905
 
@@ -10799,7 +10914,7 @@ var quit = (exitCode) => {
10799
10914
 
10800
10915
  // src/cli/commands/functions/deploy.ts
10801
10916
  import { CliInternals as CliInternals3 } from "@remotion/cli";
10802
- import { LambdaClientInternals as LambdaClientInternals16 } from "@remotion/lambda-client";
10917
+ import { LambdaClientInternals as LambdaClientInternals17 } from "@remotion/lambda-client";
10803
10918
  import {
10804
10919
  DEFAULT_CLOUDWATCH_RETENTION_PERIOD,
10805
10920
  DEFAULT_EPHEMERAL_STORAGE_IN_MB as DEFAULT_EPHEMERAL_STORAGE_IN_MB3,
@@ -10856,6 +10971,7 @@ var functionsDeploySubcommand = async ({
10856
10971
  const memorySizeInMb = parsedLambdaCli.memory ?? DEFAULT_MEMORY_SIZE;
10857
10972
  const diskSizeInMb = parsedLambdaCli.disk ?? DEFAULT_EPHEMERAL_STORAGE_IN_MB3;
10858
10973
  const customRoleArn = parsedLambdaCli["custom-role-arn"] ?? undefined;
10974
+ const customLayerArns = parsedLambdaCli["custom-layer-arns"] === undefined ? null : parsedLambdaCli["custom-layer-arns"].split(",").map((arn) => arn.trim());
10859
10975
  const createCloudWatchLogGroup = !parsedLambdaCli["disable-cloudwatch"];
10860
10976
  const enableLambdaInsights = parsedLambdaCli["enable-lambda-insights"] ?? false;
10861
10977
  const cloudWatchLogRetentionPeriodInDays = parsedLambdaCli["retention-period"] ?? DEFAULT_CLOUDWATCH_RETENTION_PERIOD;
@@ -10866,9 +10982,9 @@ var functionsDeploySubcommand = async ({
10866
10982
  const vpcSubnetIds = parsedLambdaCli["vpc-subnet-ids"] ?? undefined;
10867
10983
  const vpcSecurityGroupIds = parsedLambdaCli["vpc-security-group-ids"] ?? undefined;
10868
10984
  const runtimePreference = parsedLambdaCli["runtime-preference"] ?? "default";
10869
- LambdaClientInternals16.validateMemorySize(memorySizeInMb);
10985
+ LambdaClientInternals17.validateMemorySize(memorySizeInMb);
10870
10986
  validateTimeout(timeoutInSeconds);
10871
- LambdaClientInternals16.validateDiskSizeInMb(diskSizeInMb);
10987
+ LambdaClientInternals17.validateDiskSizeInMb(diskSizeInMb);
10872
10988
  validateCustomRoleArn(customRoleArn);
10873
10989
  validateVpcSubnetIds(vpcSubnetIds);
10874
10990
  validateVpcSecurityGroupIds(vpcSecurityGroupIds);
@@ -10882,6 +10998,7 @@ Version = ${VERSION3}
10882
10998
  CloudWatch Logging Enabled = ${createCloudWatchLogGroup}
10883
10999
  CloudWatch Retention Period = ${cloudWatchLogRetentionPeriodInDays} days
10884
11000
  Lambda Insights Enabled = ${enableLambdaInsights}
11001
+ Custom Layers = ${customLayerArns === null ? "Not specified" : customLayerArns.length}
10885
11002
 
10886
11003
  `.trim()));
10887
11004
  if (vpcSubnetIds) {
@@ -10907,6 +11024,7 @@ VPC Security Group IDs = ${vpcSecurityGroupIds}
10907
11024
  cloudWatchLogRetentionPeriodInDays,
10908
11025
  diskSizeInMb,
10909
11026
  customRoleArn,
11027
+ customLayerArns,
10910
11028
  enableLambdaInsights,
10911
11029
  indent: false,
10912
11030
  logLevel,
@@ -11224,7 +11342,7 @@ var findFunctionName = async ({
11224
11342
  if (cliFlag) {
11225
11343
  const compatibleFunctionExists = lambdasWithMatchingVersion.find((l) => l.functionName === cliFlag);
11226
11344
  if (!compatibleFunctionExists) {
11227
- Log.warn({ indent: false, logLevel }, `The name passed to --function-name "${cliFlag}" does not match the naming convention this version of the CLI expects: ${LambdaClientInternals17.innerSpeculateFunctionName({ diskSizeInMb: "[disk]", memorySizeInMb: "[memory]", timeoutInSeconds: "[timeout]" })}.`);
11345
+ Log.warn({ indent: false, logLevel }, `The name passed to --function-name "${cliFlag}" does not match the naming convention this version of the CLI expects: ${LambdaClientInternals18.innerSpeculateFunctionName({ diskSizeInMb: "[disk]", memorySizeInMb: "[memory]", timeoutInSeconds: "[timeout]" })}.`);
11228
11346
  Log.warn({ indent: false, logLevel }, "Remotion relies on the naming to determine function information. This is an unsupported workflow.");
11229
11347
  if (lambdasWithMatchingVersion.length > 0) {
11230
11348
  Log.info(logOptions, "The following functions were found:");
@@ -11326,7 +11444,7 @@ var compositionsCommand = async ({
11326
11444
  darkMode
11327
11445
  };
11328
11446
  const region = getAwsRegion();
11329
- LambdaClientInternals18.validateServeUrl(serveUrl);
11447
+ LambdaClientInternals19.validateServeUrl(serveUrl);
11330
11448
  const functionName = await findFunctionName({ logLevel, providerSpecifics });
11331
11449
  const comps = await getCompositionsOnLambda({
11332
11450
  functionName,
@@ -11348,15 +11466,21 @@ import { CliInternals as CliInternals9 } from "@remotion/cli";
11348
11466
  import { BINARY_NAME as BINARY_NAME5 } from "@remotion/lambda-client/constants";
11349
11467
 
11350
11468
  // src/cli/commands/policies/role.ts
11469
+ import { LambdaClientInternals as LambdaClientInternals20 } from "@remotion/lambda-client";
11351
11470
  var ROLE_SUBCOMMAND = "role";
11352
11471
  var roleSubcommand = (logLevel) => {
11353
- Log.info({ indent: false, logLevel }, getRolePolicy());
11472
+ const region = getAwsRegion();
11473
+ const { partition } = LambdaClientInternals20.getAwsRegionMetadata(region);
11474
+ Log.info({ indent: false, logLevel }, getRolePolicy({ partition }));
11354
11475
  };
11355
11476
 
11356
11477
  // src/cli/commands/policies/user.ts
11478
+ import { LambdaClientInternals as LambdaClientInternals21 } from "@remotion/lambda-client";
11357
11479
  var USER_SUBCOMMAND = "user";
11358
11480
  var userSubcommand = (logLevel) => {
11359
- Log.info({ indent: false, logLevel }, getUserPolicy());
11481
+ const region = getAwsRegion();
11482
+ const { partition } = LambdaClientInternals21.getAwsRegionMetadata(region);
11483
+ Log.info({ indent: false, logLevel }, getUserPolicy({ partition }));
11360
11484
  };
11361
11485
 
11362
11486
  // src/cli/commands/policies/validate.ts
@@ -11422,7 +11546,7 @@ import {
11422
11546
  RequestServiceQuotaIncreaseCommand
11423
11547
  } from "@aws-sdk/client-service-quotas";
11424
11548
  import {
11425
- LambdaClientInternals as LambdaClientInternals19
11549
+ LambdaClientInternals as LambdaClientInternals22
11426
11550
  } from "@remotion/lambda-client";
11427
11551
  import {
11428
11552
  BINARY_NAME as BINARY_NAME6,
@@ -11433,20 +11557,22 @@ var makeQuotaUrl = ({
11433
11557
  region,
11434
11558
  quotaId
11435
11559
  }) => {
11436
- return `https://${region}.console.aws.amazon.com/servicequotas/home/services/lambda/quotas/${quotaId}`;
11560
+ const { consoleDomain } = LambdaClientInternals22.getAwsRegionMetadata(region);
11561
+ return `https://${region}.${consoleDomain}/servicequotas/home/services/lambda/quotas/${quotaId}`;
11437
11562
  };
11438
11563
  async function quotasIncreaseCommand(logLevel, requestHandler) {
11439
11564
  const region = getAwsRegion();
11565
+ const { consoleDomain } = LambdaClientInternals22.getAwsRegionMetadata(region);
11440
11566
  const [concurrencyLimit, defaultConcurrencyLimit, changes] = await Promise.all([
11441
- LambdaClientInternals19.getServiceQuotasClient(region, requestHandler).send(new GetServiceQuotaCommand({
11567
+ LambdaClientInternals22.getServiceQuotasClient(region, requestHandler).send(new GetServiceQuotaCommand({
11442
11568
  QuotaCode: LAMBDA_CONCURRENCY_LIMIT_QUOTA,
11443
11569
  ServiceCode: "lambda"
11444
11570
  })),
11445
- LambdaClientInternals19.getServiceQuotasClient(region, requestHandler).send(new GetAWSDefaultServiceQuotaCommand({
11571
+ LambdaClientInternals22.getServiceQuotasClient(region, requestHandler).send(new GetAWSDefaultServiceQuotaCommand({
11446
11572
  QuotaCode: LAMBDA_CONCURRENCY_LIMIT_QUOTA,
11447
11573
  ServiceCode: "lambda"
11448
11574
  })),
11449
- LambdaClientInternals19.getServiceQuotasClient(region, requestHandler).send(new ListRequestedServiceQuotaChangeHistoryByQuotaCommand({
11575
+ LambdaClientInternals22.getServiceQuotasClient(region, requestHandler).send(new ListRequestedServiceQuotaChangeHistoryByQuotaCommand({
11450
11576
  QuotaCode: LAMBDA_CONCURRENCY_LIMIT_QUOTA,
11451
11577
  ServiceCode: "lambda"
11452
11578
  }))
@@ -11458,7 +11584,7 @@ async function quotasIncreaseCommand(logLevel, requestHandler) {
11458
11584
  logLevel
11459
11585
  };
11460
11586
  Log.warn(logOptions, `A request to increase it to ${openCase.DesiredValue} is already pending:`);
11461
- Log.warn(logOptions, `https://${region}.console.aws.amazon.com/support/home#/case/?displayId=${openCase.CaseId}`);
11587
+ Log.warn(logOptions, `https://${region}.${consoleDomain}/support/home#/case/?displayId=${openCase.CaseId}`);
11462
11588
  exit(1);
11463
11589
  }
11464
11590
  const concurrencyCurrent = concurrencyLimit.Quota?.Value;
@@ -11480,7 +11606,7 @@ async function quotasIncreaseCommand(logLevel, requestHandler) {
11480
11606
  quit(1);
11481
11607
  }
11482
11608
  try {
11483
- await LambdaClientInternals19.getServiceQuotasClient(region, requestHandler).send(new RequestServiceQuotaIncreaseCommand({
11609
+ await LambdaClientInternals22.getServiceQuotasClient(region, requestHandler).send(new RequestServiceQuotaIncreaseCommand({
11484
11610
  QuotaCode: LAMBDA_CONCURRENCY_LIMIT_QUOTA,
11485
11611
  DesiredValue: newLimit,
11486
11612
  ServiceCode: "lambda"
@@ -11506,25 +11632,26 @@ import {
11506
11632
  ListRequestedServiceQuotaChangeHistoryByQuotaCommand as ListRequestedServiceQuotaChangeHistoryByQuotaCommand2
11507
11633
  } from "@aws-sdk/client-service-quotas";
11508
11634
  import { CliInternals as CliInternals10 } from "@remotion/cli";
11509
- import { LambdaClientInternals as LambdaClientInternals20 } from "@remotion/lambda-client";
11635
+ import { LambdaClientInternals as LambdaClientInternals23 } from "@remotion/lambda-client";
11510
11636
  import {
11511
11637
  BINARY_NAME as BINARY_NAME7,
11512
11638
  LAMBDA_CONCURRENCY_LIMIT_QUOTA as LAMBDA_CONCURRENCY_LIMIT_QUOTA2
11513
11639
  } from "@remotion/lambda-client/constants";
11514
11640
  var quotasListCommand = async (logLevel) => {
11515
11641
  const region = getAwsRegion();
11642
+ const { consoleDomain } = LambdaClientInternals23.getAwsRegionMetadata(region);
11516
11643
  Log.info({ indent: false, logLevel }, CliInternals10.chalk.gray(`Region = ${region}`));
11517
11644
  Log.info({ indent: false, logLevel });
11518
11645
  const [concurrencyLimit, defaultConcurrencyLimit, changes] = await Promise.all([
11519
- LambdaClientInternals20.getServiceQuotasClient(region, null).send(new GetServiceQuotaCommand2({
11646
+ LambdaClientInternals23.getServiceQuotasClient(region, null).send(new GetServiceQuotaCommand2({
11520
11647
  QuotaCode: LAMBDA_CONCURRENCY_LIMIT_QUOTA2,
11521
11648
  ServiceCode: "lambda"
11522
11649
  })),
11523
- LambdaClientInternals20.getServiceQuotasClient(region, null).send(new GetAWSDefaultServiceQuotaCommand2({
11650
+ LambdaClientInternals23.getServiceQuotasClient(region, null).send(new GetAWSDefaultServiceQuotaCommand2({
11524
11651
  QuotaCode: LAMBDA_CONCURRENCY_LIMIT_QUOTA2,
11525
11652
  ServiceCode: "lambda"
11526
11653
  })),
11527
- LambdaClientInternals20.getServiceQuotasClient(region, null).send(new ListRequestedServiceQuotaChangeHistoryByQuotaCommand2({
11654
+ LambdaClientInternals23.getServiceQuotasClient(region, null).send(new ListRequestedServiceQuotaChangeHistoryByQuotaCommand2({
11528
11655
  QuotaCode: LAMBDA_CONCURRENCY_LIMIT_QUOTA2,
11529
11656
  ServiceCode: "lambda"
11530
11657
  }))
@@ -11540,7 +11667,7 @@ var quotasListCommand = async (logLevel) => {
11540
11667
  }
11541
11668
  if (openCase) {
11542
11669
  Log.warn({ indent: false, logLevel }, `A request to increase it to ${openCase.DesiredValue} is pending:`);
11543
- Log.warn({ indent: false, logLevel }, `https://${region}.console.aws.amazon.com/support/home#/case/?displayId=${openCase.CaseId}`);
11670
+ Log.warn({ indent: false, logLevel }, `https://${region}.${consoleDomain}/support/home#/case/?displayId=${openCase.CaseId}`);
11544
11671
  }
11545
11672
  Log.info({ indent: false, logLevel }, CliInternals10.chalk.gray("The maximum amount of Lambda functions which can concurrently execute."));
11546
11673
  Log.info({ indent: false, logLevel }, CliInternals10.chalk.gray(`Run \`npx ${BINARY_NAME7} ${QUOTAS_COMMAND} ${INCREASE_SUBCOMMAND}\` to ask AWS to increase your limit.`));
@@ -11585,7 +11712,7 @@ import { CliInternals as CliInternals14 } from "@remotion/cli";
11585
11712
  import { ConfigInternals } from "@remotion/cli/config";
11586
11713
  import {
11587
11714
  getRenderProgress,
11588
- LambdaClientInternals as LambdaClientInternals22
11715
+ LambdaClientInternals as LambdaClientInternals25
11589
11716
  } from "@remotion/lambda-client";
11590
11717
  import {
11591
11718
  BINARY_NAME as BINARY_NAME9,
@@ -11624,7 +11751,7 @@ function validateMaxRetries(maxRetries) {
11624
11751
  }
11625
11752
 
11626
11753
  // src/cli/helpers/get-s3-output-provider-from-cli.ts
11627
- import { LambdaClientInternals as LambdaClientInternals21 } from "@remotion/lambda-client";
11754
+ import { LambdaClientInternals as LambdaClientInternals24 } from "@remotion/lambda-client";
11628
11755
  var S3_OUTPUT_PROVIDER_ACCESS_KEY_ID_ENV_NAME = "REMOTION_S3_OUTPUT_PROVIDER_ACCESS_KEY_ID";
11629
11756
  var S3_OUTPUT_PROVIDER_SECRET_ACCESS_KEY_ENV_NAME = "REMOTION_S3_OUTPUT_PROVIDER_SECRET_ACCESS_KEY";
11630
11757
  var getS3OutputProviderFromCli = ({
@@ -11641,8 +11768,8 @@ var getS3OutputProviderFromCli = ({
11641
11768
  }
11642
11769
  return {
11643
11770
  endpoint,
11644
- accessKeyId: LambdaClientInternals21.getEnvVariable(S3_OUTPUT_PROVIDER_ACCESS_KEY_ID_ENV_NAME) ?? null,
11645
- secretAccessKey: LambdaClientInternals21.getEnvVariable(S3_OUTPUT_PROVIDER_SECRET_ACCESS_KEY_ENV_NAME) ?? null,
11771
+ accessKeyId: LambdaClientInternals24.getEnvVariable(S3_OUTPUT_PROVIDER_ACCESS_KEY_ID_ENV_NAME) ?? null,
11772
+ secretAccessKey: LambdaClientInternals24.getEnvVariable(S3_OUTPUT_PROVIDER_SECRET_ACCESS_KEY_ENV_NAME) ?? null,
11646
11773
  region,
11647
11774
  forcePathStyle
11648
11775
  };
@@ -12039,7 +12166,7 @@ var renderCommand = async ({
12039
12166
  let composition = args[1];
12040
12167
  if (!composition) {
12041
12168
  Log.info({ indent: false, logLevel }, "No compositions passed. Fetching compositions...");
12042
- LambdaClientInternals22.validateServeUrl(serveUrl);
12169
+ LambdaClientInternals25.validateServeUrl(serveUrl);
12043
12170
  if (!serveUrl.startsWith("https://") && !serveUrl.startsWith("http://")) {
12044
12171
  throw Error(`Passing the shorthand serve URL without composition name is currently not supported.
12045
12172
  Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.`);
@@ -12135,7 +12262,7 @@ var renderCommand = async ({
12135
12262
  const concurrency = parsedLambdaCli["concurrency"] ?? undefined;
12136
12263
  const concurrencyPerLambda = parsedLambdaCli["concurrency-per-lambda"] ?? 1;
12137
12264
  const webhookCustomData = getWebhookCustomData(logLevel);
12138
- const res = await LambdaClientInternals22.internalRenderMediaOnLambdaRaw({
12265
+ const res = await LambdaClientInternals25.internalRenderMediaOnLambdaRaw({
12139
12266
  functionName,
12140
12267
  serveUrl,
12141
12268
  inputProps,
@@ -12204,8 +12331,8 @@ var renderCommand = async ({
12204
12331
  indent: false,
12205
12332
  logLevel
12206
12333
  });
12207
- Log.info({ indent: false, logLevel }, CliInternals14.chalk.gray(`Bucket: ${CliInternals14.makeHyperlink({ text: res.bucketName, fallback: res.bucketName, url: `https://${getAwsRegion()}.console.aws.amazon.com/s3/buckets/${res.bucketName}/?region=${getAwsRegion()}` })}`));
12208
- Log.info({ indent: false, logLevel }, CliInternals14.chalk.gray(`Function: ${CliInternals14.makeHyperlink({ text: functionName, fallback: functionName, url: `https://${getAwsRegion()}.console.aws.amazon.com/lambda/home#/functions/${functionName}?tab=code` })}`));
12334
+ Log.info({ indent: false, logLevel }, CliInternals14.chalk.gray(`Bucket: ${CliInternals14.makeHyperlink({ text: res.bucketName, fallback: res.bucketName, url: LambdaClientInternals25.getS3BucketUrl({ region: getAwsRegion(), bucketName: res.bucketName }) })}`));
12335
+ Log.info({ indent: false, logLevel }, CliInternals14.chalk.gray(`Function: ${CliInternals14.makeHyperlink({ text: functionName, fallback: functionName, url: LambdaClientInternals25.getLambdaFunctionUrl({ region: getAwsRegion(), functionName }) })}`));
12209
12336
  Log.info({ indent: false, logLevel }, CliInternals14.chalk.gray(`Render ID: ${CliInternals14.makeHyperlink({ text: res.renderId, fallback: res.renderId, url: res.folderInS3Console })}`));
12210
12337
  Log.info({ indent: false, logLevel }, CliInternals14.chalk.gray(`progress.json: ${CliInternals14.makeHyperlink({
12211
12338
  text: (clickInstruction) => {
@@ -12243,7 +12370,7 @@ var renderCommand = async ({
12243
12370
  fallback: `Render folder: ${res.folderInS3Console}`
12244
12371
  }));
12245
12372
  }
12246
- const adheresToFunctionNameConvention = LambdaClientInternals22.parseFunctionName(functionName);
12373
+ const adheresToFunctionNameConvention = LambdaClientInternals25.parseFunctionName(functionName);
12247
12374
  const status = await getRenderProgress({
12248
12375
  functionName,
12249
12376
  bucketName: res.bucketName,
@@ -12820,7 +12947,7 @@ var sitesCommand = (args, remotionRoot, logLevel, providerSpecifics) => {
12820
12947
  import path9 from "path";
12821
12948
  import { CliInternals as CliInternals21 } from "@remotion/cli";
12822
12949
  import { ConfigInternals as ConfigInternals3 } from "@remotion/cli/config";
12823
- import { LambdaClientInternals as LambdaClientInternals23 } from "@remotion/lambda-client";
12950
+ import { LambdaClientInternals as LambdaClientInternals26 } from "@remotion/lambda-client";
12824
12951
  import {
12825
12952
  BINARY_NAME as BINARY_NAME12,
12826
12953
  DEFAULT_MAX_RETRIES as DEFAULT_MAX_RETRIES2,
@@ -12934,7 +13061,7 @@ var stillCommand = async ({
12934
13061
  }).value;
12935
13062
  if (!composition) {
12936
13063
  Log.info({ indent: false, logLevel }, "No compositions passed. Fetching compositions...");
12937
- LambdaClientInternals23.validateServeUrl(serveUrl);
13064
+ LambdaClientInternals26.validateServeUrl(serveUrl);
12938
13065
  if (!serveUrl.startsWith("https://") && !serveUrl.startsWith("http://")) {
12939
13066
  throw Error(`Passing the shorthand serve URL without composition name is currently not supported.
12940
13067
  Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.`);
@@ -13017,7 +13144,7 @@ var stillCommand = async ({
13017
13144
  isLambda: true,
13018
13145
  fromUi: null
13019
13146
  });
13020
- Log.info({ indent: false, logLevel }, CliInternals21.chalk.gray(`Function: ${CliInternals21.makeHyperlink({ text: functionName, fallback: functionName, url: `https://${getAwsRegion()}.console.aws.amazon.com/lambda/home#/functions/${functionName}?tab=code` })}`));
13147
+ Log.info({ indent: false, logLevel }, CliInternals21.chalk.gray(`Function: ${CliInternals21.makeHyperlink({ text: functionName, fallback: functionName, url: LambdaClientInternals26.getLambdaFunctionUrl({ region: getAwsRegion(), functionName }) })}`));
13021
13148
  Log.info({ indent: false, logLevel }, CliInternals21.chalk.gray(`Image Format = ${imageFormat} (${imageFormatReason})`));
13022
13149
  const deleteAfter = parsedLambdaCli[deleteAfterOption2.cliFlag];
13023
13150
  const scale = scaleOption2.getValue({
@@ -13026,7 +13153,7 @@ var stillCommand = async ({
13026
13153
  const jpegQuality = jpegQualityOption2.getValue({
13027
13154
  commandLine: parsedCli
13028
13155
  }).value;
13029
- const res = await LambdaClientInternals23.internalRenderStillOnLambda({
13156
+ const res = await LambdaClientInternals26.internalRenderStillOnLambda({
13030
13157
  functionName,
13031
13158
  serveUrl,
13032
13159
  inputProps,
@@ -13072,8 +13199,8 @@ var stillCommand = async ({
13072
13199
  mediaCacheSizeInBytes,
13073
13200
  isProduction: parsedLambdaCli[BrowserSafeApis5.options.isProductionOption.cliFlag] ?? true
13074
13201
  });
13075
- Log.info({ indent: false, logLevel }, CliInternals21.chalk.gray(`Render ID: ${CliInternals21.makeHyperlink({ text: res.renderId, fallback: res.renderId, url: LambdaClientInternals23.getS3RenderUrl({ bucketName: res.bucketName, renderId: res.renderId, region: getAwsRegion() }) })}`));
13076
- Log.info({ indent: false, logLevel }, CliInternals21.chalk.gray(`Bucket: ${CliInternals21.makeHyperlink({ text: res.bucketName, fallback: res.bucketName, url: `https://${getAwsRegion()}.console.aws.amazon.com/s3/buckets/${res.bucketName}/?region=${getAwsRegion()}` })}`));
13202
+ Log.info({ indent: false, logLevel }, CliInternals21.chalk.gray(`Render ID: ${CliInternals21.makeHyperlink({ text: res.renderId, fallback: res.renderId, url: LambdaClientInternals26.getS3RenderUrl({ bucketName: res.bucketName, renderId: res.renderId, region: getAwsRegion() }) })}`));
13203
+ Log.info({ indent: false, logLevel }, CliInternals21.chalk.gray(`Bucket: ${CliInternals21.makeHyperlink({ text: res.bucketName, fallback: res.bucketName, url: LambdaClientInternals26.getS3BucketUrl({ region: getAwsRegion(), bucketName: res.bucketName }) })}`));
13077
13204
  const artifactProgress = makeArtifactProgress(res.artifacts);
13078
13205
  if (artifactProgress) {
13079
13206
  Log.info({
@@ -13246,7 +13373,7 @@ var matchCommand = ({
13246
13373
  };
13247
13374
  var executeCommand = async (args, remotionRoot, logLevel, _providerSpecifics, fullClientSpecifics) => {
13248
13375
  try {
13249
- const providerSpecifics = _providerSpecifics ?? LambdaClientInternals24.awsImplementation;
13376
+ const providerSpecifics = _providerSpecifics ?? LambdaClientInternals27.awsImplementation;
13250
13377
  await matchCommand({
13251
13378
  args,
13252
13379
  remotionRoot,
@@ -13290,8 +13417,8 @@ AWS returned an "ConcurrentInvocationLimitExceeded" error message which could me
13290
13417
  `.trim());
13291
13418
  }
13292
13419
  if (error.stack?.includes("The security token included in the request is invalid")) {
13293
- const keyButDoesntStartWithAki = LambdaClientInternals24.getEnvVariable("REMOTION_AWS_ACCESS_KEY_ID") && !LambdaClientInternals24.getEnvVariable("REMOTION_AWS_ACCESS_KEY_ID").startsWith("AKI");
13294
- const pureKeyButDoesntStartWithAki = LambdaClientInternals24.getEnvVariable("AWS_ACCESS_KEY_ID") && !LambdaClientInternals24.getEnvVariable("AWS_ACCESS_KEY_ID").startsWith("AKI");
13420
+ const keyButDoesntStartWithAki = LambdaClientInternals27.getEnvVariable("REMOTION_AWS_ACCESS_KEY_ID") && !LambdaClientInternals27.getEnvVariable("REMOTION_AWS_ACCESS_KEY_ID").startsWith("AKI");
13421
+ const pureKeyButDoesntStartWithAki = LambdaClientInternals27.getEnvVariable("AWS_ACCESS_KEY_ID") && !LambdaClientInternals27.getEnvVariable("AWS_ACCESS_KEY_ID").startsWith("AKI");
13295
13422
  if (keyButDoesntStartWithAki || pureKeyButDoesntStartWithAki) {
13296
13423
  Log.error({ indent: false, logLevel }, `
13297
13424
  AWS returned an error message "The security token included in the request is invalid". A possible reason is that your AWS Access key ID is set but doesn't start with "AKI", which it usually should. The original message is: