🎥 Make videos programmatically with React
account for region in deploying sites. Docs completed for sites cli
Matt McGillivrayc7a346733ce3
diff --git a/packages/cloudrun/gcpInstaller/gcpInstaller.tar b/packages/cloudrun/gcpInstaller/gcpInstaller.tarindex 8868333336..b06fd5abf7 100644Binary files a/packages/cloudrun/gcpInstaller/gcpInstaller.tar and b/packages/cloudrun/gcpInstaller/gcpInstaller.tar differdiff --git a/packages/cloudrun/src/api/get-sites.ts b/packages/cloudrun/src/api/get-sites.tsindex a25e2ce912..d0a5f90a07 100644--- a/packages/cloudrun/src/api/get-sites.ts+++ b/packages/cloudrun/src/api/get-sites.ts@@ -2,7 +2,7 @@ import type {GcpRegion} from '../pricing/gcp-regions';import {REMOTION_BUCKET_PREFIX} from '../shared/constants';import {getCloudStorageClient} from './helpers/get-cloud-storage-client';-type Site = {+export type Site = {lastModified: number | null;bucketName: string;id: string;@@ -56,6 +56,10 @@ export const getSites = async (.bucket(bucket.name).getFiles({autoPaginate: false, delimiter: '/', prefix: 'sites/'});+ if (!apiResponse.prefixes) {+ continue; // no sites folder within bucket+ }+for (const prefix of apiResponse.prefixes) {const sitePath = prefix.split('/');diff --git a/packages/cloudrun/src/cli/commands/render/helpers/renderArgsCheck.ts b/packages/cloudrun/src/cli/commands/render/helpers/renderArgsCheck.tsindex d20a86b42e..a3a957f659 100644--- a/packages/cloudrun/src/cli/commands/render/helpers/renderArgsCheck.ts+++ b/packages/cloudrun/src/cli/commands/render/helpers/renderArgsCheck.ts@@ -17,6 +17,7 @@ import {Log} from '../../../log';export const renderArgsCheck = async (subcommand: string, args: string[]) => {let region;+ let remotionBucket;let serveUrl = args[0];if (!serveUrl) {@@ -34,8 +35,12 @@ export const renderArgsCheck = async (subcommand: string, args: string[]) => {if (!serveUrl.startsWith('https://') && !serveUrl.startsWith('http://')) {const siteName = serveUrl;Log.info('Remotion site-name passed, constructing serve url...');- const {bucketName} = await getOrCreateBucket();- serveUrl = convertToServeUrl({urlOrId: siteName, bucketName});+ region = region ?? getGcpRegion();+ remotionBucket = (await getOrCreateBucket({region})).bucketName;+ serveUrl = convertToServeUrl({+ urlOrId: siteName,+ bucketName: remotionBucket,+ });Log.info(`<serve-url> constructed: ${serveUrl}\n`);}@@ -61,10 +66,11 @@ export const renderArgsCheck = async (subcommand: string, args: string[]) => {if (!outputBucket) {region = region ?? getGcpRegion();- const {bucketName} = await getOrCreateBucket({- region,- });- outputBucket = bucketName;+ if (!remotionBucket) {+ remotionBucket = (await getOrCreateBucket({region})).bucketName;+ }++ outputBucket = remotionBucket;}let cloudRunUrl = parsedCloudrunCli['cloud-run-url'];diff --git a/packages/cloudrun/src/cli/commands/services/index.ts b/packages/cloudrun/src/cli/commands/services/index.tsindex b0d13a604b..6c4e3dd44d 100644--- a/packages/cloudrun/src/cli/commands/services/index.ts+++ b/packages/cloudrun/src/cli/commands/services/index.ts@@ -1,4 +1,5 @@import {CliInternals} from '@remotion/cli';+import type {ServiceInfo} from '../../../api/get-service-info';import {BINARY_NAME} from '../../../shared/constants';import {quit} from '../../helpers/quit';import {Log} from '../../log';@@ -9,6 +10,17 @@ import {servicesRmallCommand, SERVICES_RMALL_SUBCOMMAND} from './rmall';export const SERVICES_COMMAND = 'services';+export const displaySiteInfo = (service: ServiceInfo) => {+ const LEFT_COL = 16;+ return [+ 'Service name: '.padEnd(LEFT_COL, ' ') + ' ' + service.serviceName,+ 'Version: '.padEnd(LEFT_COL, ' ') + ' ' + service.remotionVersion,+ 'CPU Limit: '.padEnd(LEFT_COL, ' ') + ' ' + service.cpuLimit,+ 'Memory Limit: '.padEnd(LEFT_COL, ' ') + ' ' + service.memoryLimit,+ 'Timeout: '.padEnd(LEFT_COL, ' ') + ' ' + service.timeoutInSeconds + 'sec',+ ].join('\n');+};+const printCloudRunHelp = () => {Log.info(`${BINARY_NAME} ${SERVICES_COMMAND} <subcommand>`);Log.info();diff --git a/packages/cloudrun/src/cli/commands/services/rm.ts b/packages/cloudrun/src/cli/commands/services/rm.tsindex 3beb55c6a4..3c29dfe048 100644--- a/packages/cloudrun/src/cli/commands/services/rm.ts+++ b/packages/cloudrun/src/cli/commands/services/rm.ts@@ -6,11 +6,10 @@ import {getGcpRegion} from '../../get-gcp-region';import {confirmCli} from '../../helpers/confirm';import {quit} from '../../helpers/quit';import {Log} from '../../log';-import {SERVICES_COMMAND} from './index';+import {displaySiteInfo, SERVICES_COMMAND} from './index';import {SERVICES_LS_SUBCOMMAND} from './ls';export const SERVICES_RM_SUBCOMMAND = 'rm';-const LEFT_COL = 16;export const servicesRmCommand = async (args: string[]) => {if (args.length === 0) {@@ -42,15 +41,7 @@ export const servicesRmCommand = async (args: string[]) => {serviceName,});- infoOutput.update(- [- 'Service name: '.padEnd(LEFT_COL, ' ') + ' ' + info.serviceName,- 'Version: '.padEnd(LEFT_COL, ' ') + ' ' + info.remotionVersion,- 'CPU Limit: '.padEnd(LEFT_COL, ' ') + ' ' + info.cpuLimit,- 'Memory Limit: '.padEnd(LEFT_COL, ' ') + ' ' + info.memoryLimit,- 'Timeout: '.padEnd(LEFT_COL, ' ') + ' ' + info.timeoutInSeconds + 'sec',- ].join('\n')- );+ infoOutput.update(displaySiteInfo(info));Log.info();const confirmDelete = await confirmCli({diff --git a/packages/cloudrun/src/cli/commands/services/rmall.ts b/packages/cloudrun/src/cli/commands/services/rmall.tsindex 2ce9c2194d..b3a7aeec5a 100644--- a/packages/cloudrun/src/cli/commands/services/rmall.ts+++ b/packages/cloudrun/src/cli/commands/services/rmall.ts@@ -1,4 +1,5 @@import {CliInternals} from '@remotion/cli';+import {displaySiteInfo} from '.';import {deleteService} from '../../../api/delete-service';import {getServiceInfo} from '../../../api/get-service-info';import {getServices} from '../../../api/get-services';@@ -7,7 +8,6 @@ import {confirmCli} from '../../helpers/confirm';import {Log} from '../../log';export const SERVICES_RMALL_SUBCOMMAND = 'rmall';-const LEFT_COL = 16;export const servicesRmallCommand = async () => {const region = getGcpRegion();@@ -27,15 +27,8 @@ export const servicesRmallCommand = async () => {serviceName: serv.serviceName,});- infoOutput.update(- [- 'Service name: '.padEnd(LEFT_COL, ' ') + ' ' + info.serviceName,- 'Version: '.padEnd(LEFT_COL, ' ') + ' ' + info.remotionVersion,- 'CPU Limit: '.padEnd(LEFT_COL, ' ') + ' ' + info.cpuLimit,- 'Memory Limit: '.padEnd(LEFT_COL, ' ') + ' ' + info.memoryLimit,- 'Timeout: '.padEnd(LEFT_COL, ' ') + ' ' + info.timeoutInSeconds + 'sec',- ].join('\n')- );+ infoOutput.update(displaySiteInfo(info));+Log.info();const confirmDelete = await confirmCli({diff --git a/packages/cloudrun/src/cli/commands/sites/index.ts b/packages/cloudrun/src/cli/commands/sites/index.tsindex 4f32171ee5..756b57462e 100644--- a/packages/cloudrun/src/cli/commands/sites/index.ts+++ b/packages/cloudrun/src/cli/commands/sites/index.ts@@ -1,4 +1,5 @@import {CliInternals} from '@remotion/cli';+import type {Site} from '../../../api/get-sites';import {BINARY_NAME} from '../../../shared/constants';import {quit} from '../../helpers/quit';import {Log} from '../../log';@@ -9,6 +10,16 @@ import {sitesRmallSubcommand, SITES_RMALL_COMMAND} from './rmall';export const SITES_COMMAND = 'sites';+export const displaySiteInfo = (site: Site) => {+ const LEFT_COL = 16;+ return [+ 'Site: '.padEnd(LEFT_COL, ' ') + ' ' + site.id,+ 'Bucket: '.padEnd(LEFT_COL, ' ') + ' ' + site.bucketName,+ 'Region: '.padEnd(LEFT_COL, ' ') + ' ' + site.bucketRegion,+ 'Serve Url: '.padEnd(LEFT_COL, ' ') + ' ' + site.serveUrl,+ ].join('\n');+};+const printSitesHelp = () => {Log.info(`${BINARY_NAME} ${SITES_COMMAND} <subcommand>`);Log.info();diff --git a/packages/cloudrun/src/cli/commands/sites/ls.ts b/packages/cloudrun/src/cli/commands/sites/ls.tsindex e0bd269b10..a26864115a 100644--- a/packages/cloudrun/src/cli/commands/sites/ls.ts+++ b/packages/cloudrun/src/cli/commands/sites/ls.ts@@ -1,20 +1,12 @@import {CliInternals} from '@remotion/cli';+import {displaySiteInfo} from '.';import {getSites} from '../../../api/get-sites';import {parsedCloudrunCli} from '../../args';import {getGcpRegion} from '../../get-gcp-region';+import {Log} from '../../log';export const SITES_LS_SUBCOMMAND = 'ls';-const COLS: [number, number, number] = [20, 30, 15];--const logRow = (data: [string, string, string]) => {- return [- data[0].padEnd(COLS[0], ' '),- data[1].padEnd(COLS[1], ' '),- String(data[2]).padEnd(COLS[2], ' '),- ].join('');-};-export const sitesLsSubcommand = async () => {// check if --allRegions flag is provided// if so, list all sites@@ -25,40 +17,34 @@ export const sitesLsSubcommand = async () => {const {sites, buckets} = await getSites(region);- if (buckets.length > 1 && !CliInternals.quietFlagProvided()) {- CliInternals.Log.warn(- 'Warning: You have more than one Remotion Cloud Storage bucket, but only one is needed. This can lead to conflicts. Remove all but one of them.'+ if (buckets.length > 1 && !CliInternals.quietFlagProvided() && !allRegions) {+ Log.warn(+ `Warning: You have more than one Remotion Cloud Storage bucket in ${region}, but only one is needed. This can lead to conflicts. Remove all but one of them.`);}const sitesPluralized = sites.length === 1 ? 'site' : 'sites';if (!CliInternals.quietFlagProvided()) {- CliInternals.Log.info(+ Log.info(`${sites.length} ${sitesPluralized} in ${region}, in the ${process.env.REMOTION_GCP_PROJECT_ID} project.`);}if (CliInternals.quietFlagProvided()) {if (sites.length === 0) {- CliInternals.Log.info('()');+ Log.info('()');return;}- return CliInternals.Log.info(sites.map((s) => s.id).join(' '));+ return Log.info(sites.map((s) => s.id).join(' '));}if (sites.length > 0) {- CliInternals.Log.info();- CliInternals.Log.info(- CliInternals.chalk.gray(logRow(['Site Name', 'Bucket', 'Region']))- );+ Log.info();for (const site of sites) {- CliInternals.Log.info(- logRow([site.id, site.bucketName, site.bucketRegion])- );- CliInternals.Log.info(site.serveUrl);- CliInternals.Log.info();+ Log.info(displaySiteInfo(site));+ Log.info();}}};diff --git a/packages/cloudrun/src/cli/commands/sites/rm.ts b/packages/cloudrun/src/cli/commands/sites/rm.tsindex 6cc1bfc7e9..7a557f0582 100644--- a/packages/cloudrun/src/cli/commands/sites/rm.ts+++ b/packages/cloudrun/src/cli/commands/sites/rm.ts@@ -1,18 +1,24 @@import {CliInternals} from '@remotion/cli';+import {displaySiteInfo, SITES_COMMAND} from '.';import {deleteSite} from '../../../api/delete-site';import {getSites} from '../../../api/get-sites';+import {BINARY_NAME} from '../../../shared/constants';+import {getGcpRegion} from '../../get-gcp-region';import {confirmCli} from '../../helpers/confirm';import {quit} from '../../helpers/quit';import {Log} from '../../log';+import {SITES_LS_SUBCOMMAND} from './ls';export const SITES_RM_COMMAND = 'rm';-const LEFT_COL = 16;export const sitesRmSubcommand = async (args: string[]) => {if (args.length === 0) {Log.error('No site name was passed. Run the command again and pass another argument <site-name>.');+ Log.error(+ `To get a list of sites, run \`${BINARY_NAME} ${SITES_COMMAND} ${SITES_LS_SUBCOMMAND}\``+ );quit(1);}@@ -21,33 +27,30 @@ export const sitesRmSubcommand = async (args: string[]) => {return;}- const deployedSites = await getSites('all regions');+ const region = getGcpRegion();+ const infoOutput = CliInternals.createOverwriteableCliOutput({+ quiet: CliInternals.quietFlagProvided(),+ cancelSignal: null,+ });+ infoOutput.update(`Checking ${region} for sites...`);++ const deployedSites = await getSites(region);for (const siteName of args) {- const infoOutput = CliInternals.createOverwriteableCliOutput({- quiet: CliInternals.quietFlagProvided(),- cancelSignal: null,- });infoOutput.update('Getting site info...');const site = deployedSites.sites.find((s) => s.id === siteName.trim());if (!site) {- throw new Error(`${siteName.trim()} was not found.`);+ infoOutput.update('');+ throw new Error(`${siteName.trim()} was not found in ${region}.`);}- infoOutput.update(- [- 'Site: '.padEnd(LEFT_COL, ' ') + ' ' + site.id,- 'Bucket: '.padEnd(LEFT_COL, ' ') + ' ' + site.bucketName,- 'Region: '.padEnd(LEFT_COL, ' ') + ' ' + site.bucketRegion,- 'Serve Url: '.padEnd(LEFT_COL, ' ') + ' ' + site.serveUrl,- ].join('\n')- );+ infoOutput.update(displaySiteInfo(site));Log.info();Log.info();const confirmDelete = await confirmCli({- delMessage: `Site ${site.id} in bucket ${site.bucketName}: Delete? (Y/n)`,+ delMessage: 'Delete? (Y/n)',allowForceFlag: true,});diff --git a/packages/cloudrun/src/cli/commands/sites/rmall.ts b/packages/cloudrun/src/cli/commands/sites/rmall.tsindex 1d405d8129..4307738777 100644--- a/packages/cloudrun/src/cli/commands/sites/rmall.ts+++ b/packages/cloudrun/src/cli/commands/sites/rmall.ts@@ -1,32 +1,42 @@+import {displaySiteInfo} from '.';import {deleteSite} from '../../../api/delete-site';-import {getOrCreateBucket} from '../../../api/get-or-create-bucket';import {getSites} from '../../../api/get-sites';+import {parsedCloudrunCli} from '../../args';+import {getGcpRegion} from '../../get-gcp-region';import {confirmCli} from '../../helpers/confirm';import {Log} from '../../log';export const SITES_RMALL_COMMAND = 'rmall';export const sitesRmallSubcommand = async () => {- const deployedSites = await getSites();+ const allRegions = parsedCloudrunCli['all-regions'];- const {bucketName} = await getOrCreateBucket();+ const region = allRegions ? 'all regions' : getGcpRegion();+ Log.info(`Retrieving sites in ${region}.`);++ const deployedSites = await getSites(region);for (const site of deployedSites.sites) {+ Log.info();+ Log.info(displaySiteInfo(site));+ Log.info();const confirmDelete = await confirmCli({- delMessage: `Site ${site.id} in bucket ${site.bucketName}: Delete? (Y/n)`,+ delMessage: 'Delete? (Y/n)',allowForceFlag: true,});if (!confirmDelete) {Log.info(`Skipping site - ${site.id}.`);+ Log.info();continue;}await deleteSite({- bucketName,+ bucketName: site.bucketName,siteName: site.id,});Log.info(`Deleted site ${site.id} from bucket ${site.bucketName}.`);+ Log.info();}};diff --git a/packages/docs/docs/cloudrun/cli/sites.md b/packages/docs/docs/cloudrun/cli/sites.mdindex cec41cb3d7..1135a074e1 100644--- a/packages/docs/docs/cloudrun/cli/sites.md+++ b/packages/docs/docs/cloudrun/cli/sites.md@@ -53,14 +53,14 @@ Site Name: mySite123<br/>### `--region`-The [GCP region](/docs/cloudrun/region-selection) to select. The service should also be in this same region to minimise latency.+The [GCP region](/docs/cloudrun/region-selection) to select. The service accessing the site should also be in this same region to minimise latency.### `--site-name`-Uploads the project to a specific directory and returns a deterministic URL. If a site already existed under this name, it will be overwritten. Can only contain the following characters: `0-9`, `a-z`, `A-Z`, `-`, `!`, `_`, `.`, `*`, `'`, `(`, `)`+Uploads the project to a specific directory and returns a deterministic URL. If a site already existed under this name, in the same region, it will be overwritten. Can only contain the following characters: `0-9`, `a-z`, `A-Z`, `-`, `!`, `_`, `.`, `*`, `'`, `(`, `)````-npx remotion cloudrun sites create src/index.ts --site-name=my-project+npx remotion cloudrun sites create src/index.ts --site-name=another-site```<details>@@ -70,11 +70,11 @@ Example output<pre>(1/3) [====================] Bundled video 3975ms<br/>(2/3) [====================] Created bucket 457ms<br/>-(3/3) [====================] Uploaded to S3 25118ms<br/>+(3/3) [====================] Uploaded to Cloud Storage 25118ms<br/><br/>Deployed to GCP Cloud Storage!<br/>-Serve URL: https://storage.googleapis.com/remotioncloudrun-12345/sites/my-project/index.html<br/>-Site Name: my-project<br/>+Serve URL: https://storage.googleapis.com/remotioncloudrun-12345/sites/another-site/index.html<br/>+Site Name: another-site<br/></pre></details>@@ -93,20 +93,27 @@ Example output</summary><pre>2 sites in us-east1, in the remotion-6 project.<br/><br/>-Site Name Bucket Region<br/>-another-site remotioncloudrun-abcdefg us-east1<br/>-https://storage.googleapis.com/remotioncloudrun-abcdefg/sites/another-site/index.html<br/><br/>-test-site remotioncloudrun-abcdefg us-east1 <br/>-https://storage.googleapis.com/remotioncloudrun-abcdefg/sites/test-site/index.html<br/>+Site: another-site<br/>+Bucket: remotioncloudrun-12345<br/>+Region: us-east1<br/>+Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/another-site/index.html<br/><br/>+Site: test-site<br/>+Bucket: remotioncloudrun-12345<br/>+Region: us-east1<br/>+Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/test-site/index.html<br/></pre></details>-### `--quiet`, `-q`+### `--region`-Returns only a list of space-separated sites.+The [GCP region](/docs/cloudrun/region-selection) to list sites from.++### `--all-regions`,++Ignores region, returning sites across all regions for the project.```-npx remotion cloudrun sites ls -q+npx remotion cloudrun sites ls --all-regions```<details>@@ -114,16 +121,28 @@ npx remotion cloudrun sites ls -qExample output</summary><pre>-pr6fwglz05 testbed<br/>+3 sites in all regions, in the remotion-6 project.<br/><br/>+Site: another-site<br/>+Bucket: remotioncloudrun-12345<br/>+Region: us-east1<br/>+Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/another-site/index.html<br/><br/>+Site: test-site<br/>+Bucket: remotioncloudrun-12345<br/>+Region: us-east1<br/>+Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/test-site/index.html<br/><br/>+Site: central-site<br/>+Bucket: remotioncloudrun-abcdefgh<br/>+Region: us-central1<br/>+Serve Url: https://storage.googleapis.com/remotioncloudrun-abcdefgh/sites/central-site/index.html</pre></details>-### `--all-regions`,+### `--quiet`, `-q`-Ignores region, returning sites across all regions for the project+Returns only a list of space-separated sites.```-npx remotion cloudrun sites ls --all-regions+npx remotion cloudrun sites ls -q```<details>@@ -131,14 +150,7 @@ npx remotion cloudrun sites ls --all-regionsExample output</summary><pre>-3 sites in all regions, in the remotion-6 project.<br/><br/>-Site Name Bucket Region<br/>-another-site remotioncloudrun-abcdefg us-east1<br/>-https://storage.googleapis.com/remotioncloudrun-abcdefg/sites/another-site/index.html<br/><br/>-test-site remotioncloudrun-abcdefg us-east1 <br/>-https://storage.googleapis.com/remotioncloudrun-abcdefg/sites/test-site/index.html<br/><br/>-central-site remotioncloudrun-123456 us-central1 <br/>-https://storage.googleapis.com/remotioncloudrun-123456/sites/central-site/index.html<br/>+another-site test-site central-site<br/></pre></details>@@ -157,18 +169,26 @@ Example output</summary><pre>Site: central-site<br/>-Bucket: remotioncloudrun-123456<br/>+Bucket: remotioncloudrun-abcdefgh<br/>Region: us-central1<br/>-Serve Url: https://storage.googleapis.com/remotioncloudrun-123456/sites/central-site/index.html<br/><br/>-Site central-site in bucket remotioncloudrun-123456: Delete? (Y/n): Y<br/>-Deleted site central-site from bucket remotioncloudrun-123456.+Serve Url: https://storage.googleapis.com/remotioncloudrun-abcdefgh/sites/central-site/index.html<br/><br/>+Delete? (Y/n) Y<br/>+Deleted site central-site from bucket remotioncloudrun-abcdefgh.<br/></pre></details>+### `--region`++The [GCP region](/docs/cloudrun/region-selection) to remove sites from.++:::note+The `rm` command does not support the --all-regions flag, as it is possible to have the same site name in multiple regions. This makes it difficult to remove multiple site-names from multiple regions.+:::+### `--yes`, `-y`-Removes a site without asking for confirmation.+Removes a site (or multiple) without asking for confirmation.```npx remotion cloudrun sites rm central-site -y@@ -186,9 +206,59 @@ npx remotion cloudrun sites rmall<summary>Example output</summary>-<pre>Site abcdef in bucket remotionlambda-gc1w0xbfzl: Delete? (Y/n): Y-<br/>Deleted site abcdef from bucket remotionlambda-gc1w0xbfzl.-<br/>+<pre>+Retrieving sites in us-east1.<br/><br/>+Site: another-site<br/>+Bucket: remotioncloudrun-12345<br/>+Region: us-east1<br/>+Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/another-site/index.html<br/><br/>+Delete? (Y/n) n<br/>+Skipping site - another-site.<br/><br/><br/>+Site: test-site<br/>+Bucket: remotioncloudrun-12345<br/>+Region: us-east1<br/>+Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/test-site/index.html<br/><br/>+Delete? (Y/n) n<br/>+Skipping site - test-site.+</pre>+</details>++### `--region`++The [GCP region](/docs/cloudrun/region-selection) to remove all sites from.++### `--all-regions`,++Ignores region, removing sites across all regions for the project.++```+npx remotion cloudrun sites rmall --all-regions+```++<details>+<summary>+Example output+</summary>+<pre>+Retrieving sites in all regions.<br/><br/>+Site: another-site<br/>+Bucket: remotioncloudrun-12345<br/>+Region: us-east1<br/>+Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/another-site/index.html<br/><br/>+Delete? (Y/n) n<br/>+Skipping site - another-site.<br/><br/><br/>+Site: test-site<br/>+Bucket: remotioncloudrun-12345<br/>+Region: us-east1<br/>+Serve Url: https://storage.googleapis.com/remotioncloudrun-12345/sites/test-site/index.html<br/><br/>+Delete? (Y/n) n<br/>+Skipping site - test-site.<br/><br/><br/>+Site: central-site<br/>+Bucket: remotioncloudrun-abcdefgh<br/>+Region: us-central1<br/>+Serve Url: https://storage.googleapis.com/remotioncloudrun-abcdefgh/sites/central-site/index.html<br/><br/>+Delete? (Y/n) n<br/>+Skipping site - central-site.</pre></details>diff --git a/packages/docs/docs/cloudrun/region-selection.md b/packages/docs/docs/cloudrun/region-selection.mdindex 84bf1472df..8c1a170c3c 100644--- a/packages/docs/docs/cloudrun/region-selection.md+++ b/packages/docs/docs/cloudrun/region-selection.md@@ -26,11 +26,17 @@ The default region is `us-east1`.## Selecting a region-There are 3 ways of selection a region:+There are 3 ways to select 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.-- You can pass the `--region` flag to all CLI commands to set the region.+- When using the CLI, you can set the region using the `REMOTION_GCP_REGION` environment variable. It's best to put it in a `.env` file so you don't forget it sometimes.++- You can also pass the `--region` flag to all CLI commands to override the region. The flag takes precedence over the environment variable.++:::info+The REMOTION_GCP_REGION environment variable and `--region` flag do not have an effect when using the Node.JS APIs. You need to pass a region explicitly.+:::If you don't set a region, Remotion will use the default region.@@ -40,4 +46,4 @@ Note that each region falls into one of two different pricing tiers. Some region## Other considerations-- The Cloud Run service and Cloud Storage bucket must be in the same region to eliminate latency across datacenters.+- The Cloud Run service and Cloud Storage bucket should be in the same region to eliminate latency across datacenters.