🎥 Make videos programmatically with React
region selection page
Jonny Burgere006e5b69686
diff --git a/packages/docs/components/lambda/regions.tsx b/packages/docs/components/lambda/regions.tsxnew file mode 100644index 0000000000..c96e3e9668--- /dev/null+++ b/packages/docs/components/lambda/regions.tsx@@ -0,0 +1,16 @@+import { AWS_REGIONS } from "@remotion/lambda/dist/regions";+import React from "react";++export const LambdaRegionList: React.FC = () => {+ return (+ <div>+ {AWS_REGIONS.map((region) => {+ return (+ <span key={region}>+ <code>{region}</code>{" "}+ </span>+ );+ })}+ </div>+ );+};diff --git a/packages/docs/docs/region-selection.md b/packages/docs/docs/region-selection.mdnew file mode 100644index 0000000000..061f56adc4--- /dev/null+++ b/packages/docs/docs/region-selection.md@@ -0,0 +1,58 @@+---+id: lambda-region-selection+title: Region selection+slug: /lambda/region-selection+---++import {LambdaRegionList} from '../components/lambda/regions.tsx';++Before starting with Remotion Lambda, you need to think about into which AWS region you are deploying your function and bucket.++This document explains how to select a region and which considerations you need to make.++## Available regions++The following AWS regions are available:++<LambdaRegionList />++## Default region++The default region is `us-east-1`.++## Selecting a region++There are 3 ways of selection a region:++- When using the Node.JS APIs, you have to pass the region explicitly to each function. Make sure your projects satisfy the Typescript types or follow the documentation.++- When using the CLI, you can set the region using the `AWS_REGION` environment variable. It's best to put it in a `.env` file so you don't forget it sometimes.++:::info+The AWS_REGION environment variable does not work when using the Node.JS APIs.+:::++- You can also pass the `--region` flag to all CLI commands to override the region. The flag takes precedence over the environment variable.++If you don't set a region, Remotion will use the default region.++## Which region should I choose?++Note that different regions have a different limit on how many Lambda functions can be started in a short amount of time [("burst limit")](https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html).++- `us-east-1`, `us-west-2`, `eu-west-1`: Burst concurrency = 3000+- `ap-northeast-1`, `eu-central-1`, `us-east-2`: Burst concurrency = 1000+- All other regions = 500++**Because of this, we recommend hosting your infrastructure in `us-east-1`, `us-west-2` or `eu-west-1` for maximum scalability.**++## 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++- You may deploy your whole architecture to different regions to further increase the amount of renders you can make concurrently. The tradeoff is higher redundancy, and not being able to benefit less from already warm functions and chunk optimization.++- Some regions are more expensive than others (for example `af-south-1`).+ Consult the [Lambda Pricing page](https://aws.amazon.com/lambda/pricing/) from AWS.++- Some regions [are disabled by default](https://docs.aws.amazon.com/general/latest/gr/rande-manage.html) and you need to enable them in your AWS account before you can use them.diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.jsindex b3d2ea825e..8eb3c18a39 100644--- a/packages/docs/sidebars.js+++ b/packages/docs/sidebars.js@@ -9,6 +9,7 @@ module.exports = {"lambda-cli","lambda-setup","lambda-permissions",+ "lambda-region-selection",{collapsed: false,type: "category",diff --git a/packages/lambda/src/regions.ts b/packages/lambda/src/regions.tsnew file mode 100644index 0000000000..3c43e1d22f--- /dev/null+++ b/packages/lambda/src/regions.ts@@ -0,0 +1,3 @@+import {AWS_REGIONS} from './pricing/aws-regions';++export {AWS_REGIONS};