Skip to content

🎥 Make videos programmatically with React

handle more regions

Jonny Burger77b7f5e60d27
diff --git a/packages/docs/docs/lambda/region-selection.md b/packages/docs/docs/lambda/region-selection.md
index 2f1777bf4f..2af227595c 100644
--- a/packages/docs/docs/lambda/region-selection.md
+++ b/packages/docs/docs/lambda/region-selection.md
@@ -54,6 +54,16 @@ Note that different regions have a different limit on how many Lambda functions
**Because of this, we recommend hosting your primary infrastructure in `us-east-1`, `us-west-2` or `eu-west-1` for maximum scalability.**
+## Enabling regions in the AWS console
+
+Some regions that are supported by Remotion are not enabled by default in an AWS account. If you get a message:
+
+```
+The security token included in the request is invalid
+```
+
+Go to the AWS console, click on your name, then click `Account` and enable the regions that you would like to use.
+
## Other considerations
- The function and S3 bucket must be in the same region to eliminate latency across datacenters. Rendering with functions and buckets that ahave mismatching regions is not supported
diff --git a/packages/example/testlambda.sh b/packages/example/testlambda.sh
index 484d1e01d7..b74899bcf1 100644
--- a/packages/example/testlambda.sh
+++ b/packages/example/testlambda.sh
@@ -7,4 +7,4 @@ pnpm exec remotion lambda policies validate
pnpm exec remotion lambda functions rmall -f
pnpm exec remotion lambda functions deploy --memory=3000
pnpm exec remotion lambda sites create --site-name=testbed --log=verbose
-pnpm exec remotion lambda render testbed react-svg --out-name=ggg.mp4 ggg.mp4 --log=verbose
+pnpm exec remotion lambda render testbed react-svg --out-name=ggg.mp4 ggg.mp4 --log=verbose
diff --git a/packages/lambda/src/cli/index.ts b/packages/lambda/src/cli/index.ts
index 48ddbd554b..9b8eb0a174 100644
--- a/packages/lambda/src/cli/index.ts
+++ b/packages/lambda/src/cli/index.ts
@@ -167,6 +167,18 @@ AWS returned an "TooManyRequestsException" error message which could mean you re
);
}
+ if (
+ error.stack?.includes(
+ 'The security token included in the request is invalid'
+ )
+ ) {
+ Log.error(
+ `
+AWS returned an error message "The security token included in the request is invalid". A possible reason for this is that you did not enable the region in your AWS account under "Account". The original message is:
+`
+ );
+ }
+
Log.error(error.stack);
quit(1);
}