🎥 Make videos programmatically with React
progress
Jonny Burger565cdd2022e6
diff --git a/packages/docs/docs/lambda-cli.md b/packages/docs/docs/lambda-cli.mdindex 8af197809c..321d966733 100644--- a/packages/docs/docs/lambda-cli.md+++ b/packages/docs/docs/lambda-cli.md@@ -7,12 +7,40 @@ slug: /lambda/cliYou can get a list of all commands using `npx remotion-lambda --help`.-## upload+## Global options++You can specify `--region` to select an AWS region: For example:++```console+--region=eu-central-1+```++The default region is `us-east-1`. You may also set a `AWS_REGION` environment variable directly or via `.env` file.++## sites++### createUploads a Remotion project to an S3 bucket. You will get a URL which you can pass to the `render` command to render the video.```console-npx remotion-lambda upload src/index.ts+npx remotion-lambda sites create src/index.ts+```++###Â ls++Lists the sites uploaded to the S3 buckets++```console+npx remotion-lambda sites ls+```++### rm++Deletes a site from an S3 bucket.++```console+npx remotion-lambda sites rm f87nffa```## policies@@ -43,14 +71,6 @@ Validate the current policies setup is correct by running tests using the AWS ponpx remotion-lambda policies validate```-## cleanup--This command helps remove Remotion-related resources from your AWS account.--```-npx remotion-lambda cleanup-```-## renderRenders a video using Remotion Lambda. You need to pass two arguments:@@ -62,10 +82,36 @@ Renders a video using Remotion Lambda. You need to pass two arguments:npx remotion-lambda render https://remotionlambda-abcdefgh.s3.eu-central-1.amazonaws.com/sites/abcdefgh HelloWorld```-## deploy+## functions++### deployDeploys a Remotion render lambda function to your account. You only need 1 function to render videos.```npx remotion-lambda functions deploy```++### ls++List the functions deployed to your AWS account.++```console+npx remotion-lambda functions ls+```++### rm++Removes a render function from your AWS account.++```console+npx remotion-lambda functions rm remotion-lambda-4y2y1aaf+```++## cleanup++This command helps remove Remotion-related resources from your AWS account.++```+npx remotion-lambda cleanup+```diff --git a/packages/docs/docs/lambda-setup.md b/packages/docs/docs/lambda-setup.mdindex 5b95b83b32..3ff417f9b7 100644--- a/packages/docs/docs/lambda-setup.md+++ b/packages/docs/docs/lambda-setup.md@@ -71,7 +71,7 @@ AWS_SECRET_ACCESS_KEY=xxx## 8. Deploy a website-- Run `npx remotion-lambda upload`+- Run `npx remotion-lambda sites create src/index.tsx`## 9. Render a videodiff --git a/packages/docs/docs/lambda.md b/packages/docs/docs/lambda.mdindex 33aab2aef8..5411c675b7 100644--- a/packages/docs/docs/lambda.md+++ b/packages/docs/docs/lambda.md@@ -116,8 +116,8 @@ A mechanism that determines after a render which frames rendered the slowest opt- [ ] Parallelism is not configurable- [ ] Rendering using more than 1000 chunks is undefined behavior, things will break- [x] ~~`eu-central-1` region is hardcoded~~-- [ ] 2048 MB RAM is hardcoded-- [ ] Lambda timeout of 120 seconds is hardcoded+- [x] 2048 MB RAM is hardcoded+- [x] Lambda timeout of 120 seconds is hardcoded- [ ] There is no way to disable chunk optimization## Licensediff --git a/packages/lambda/src/cli/commands/policies/role.ts b/packages/lambda/src/cli/commands/policies/role.tsindex 3972d33c90..08d30ee707 100644--- a/packages/lambda/src/cli/commands/policies/role.ts+++ b/packages/lambda/src/cli/commands/policies/role.ts@@ -3,6 +3,5 @@ import {Log} from '../../log';export const ROLE_SUBCOMMAND = 'role';export const roleSubcommand = () => {- Log.info('Policy for role:');Log.info(JSON.stringify(getRolePolicy(), null, 2));};diff --git a/packages/lambda/src/cli/commands/policies/user.ts b/packages/lambda/src/cli/commands/policies/user.tsindex c2f68a97c9..fca65a6566 100644--- a/packages/lambda/src/cli/commands/policies/user.ts+++ b/packages/lambda/src/cli/commands/policies/user.ts@@ -4,6 +4,5 @@ import {Log} from '../../log';export const USER_SUBCOMMAND = 'user';export const userSubcommand = () => {- Log.info('Policy for user:');Log.info(JSON.stringify(getUserPolicy(), null, 2));};diff --git a/packages/lambda/src/cli/commands/sites/upload.ts b/packages/lambda/src/cli/commands/sites/create.tssimilarity index 96%rename from packages/lambda/src/cli/commands/sites/upload.tsrename to packages/lambda/src/cli/commands/sites/create.tsindex fc3097120b..0db3f61d4d 100644--- a/packages/lambda/src/cli/commands/sites/upload.ts+++ b/packages/lambda/src/cli/commands/sites/create.ts@@ -15,9 +15,9 @@ import {} from '../../helpers/progress-bar';import {Log} from '../../log';-export const SITES_UPLOAD_SUBCOMMAND = 'create';+export const SITES_CREATE_SUBCOMMAND = 'create';-export const sitesUploadSubcommand = async (args: string[]) => {+export const sitesCreateSubcommand = async (args: string[]) => {const fileName = args[0];if (!fileName) {Log.error('No entry file passed.');diff --git a/packages/lambda/src/cli/commands/sites/index.ts b/packages/lambda/src/cli/commands/sites/index.tsindex 7796df78ba..7cf93b4f90 100644--- a/packages/lambda/src/cli/commands/sites/index.ts+++ b/packages/lambda/src/cli/commands/sites/index.ts@@ -1,9 +1,12 @@import {CliInternals} from '@remotion/cli';import {Log} from '@remotion/cli/dist/log';import {BINARY_NAME} from '../../../shared/constants';+import {+ sitesCreateSubcommand,+ SITES_UPLOAD_SUBCOMMAND as SITES_CREATE_SUBCOMMAND,+} from './create';import {sitesLsSubcommand, SITES_LS_SUBCOMMAND} from './ls';import {sitesRmSubcommand, SITES_RM_COMMAND} from './rm';-import {sitesUploadSubcommand, SITES_UPLOAD_SUBCOMMAND} from './upload';export const SITES_COMMAND = 'sites';@@ -13,7 +16,7 @@ export const printSitesHelp = () => {Log.info('Available subcommands:');Log.info();Log.info(- `${BINARY_NAME} ${SITES_COMMAND} ${SITES_UPLOAD_SUBCOMMAND} <entry-point>`+ `${BINARY_NAME} ${SITES_COMMAND} ${SITES_CREATE_SUBCOMMAND} <entry-point>`);Log.info(CliInternals.chalk.gray('Creates a new site based on a Remotion project')@@ -35,8 +38,8 @@ export const sitesCommand = (args: string[]) => {return sitesRmSubcommand(args.slice(1));}- if (args[0] === SITES_UPLOAD_SUBCOMMAND) {- return sitesUploadSubcommand(args.slice(1));+ if (args[0] === SITES_CREATE_SUBCOMMAND) {+ return sitesCreateSubcommand(args.slice(1));}if (args[0]) {