packages/docs/docs/cloudrun/speculateservicename.mdx
Speculate the name of the Cloud Run service that will be created by deployService() or its CLI equivalent, npx remotion cloudrun services deploy. This could be useful in cases when the configuration of the Cloud Run service is known in advance, and the name of the service is needed.
If you are not sure whether a service exists, use getServiceInfo() and catch the error that gets thrown if it does not exist.
If you want to get a list of deployed services, use getServices() instead.
The service name depends on the following parameters:
The name of the service resembles the following pattern:
remotion--3-3-96--mem2gi--cpu1-0--t-1900
^^^^^^ ^^^ ^^^ ^^^
| | | |-- Timeout in seconds
| | |----------- Cpu limit
| |------------------- Memory limit
|--------------------------- Remotion version with dots replaced by dashes
import {speculateServiceName} from '@remotion/cloudrun';
const speculatedServiceName = speculateServiceName({
memoryLimit: '2Gi',
cpuLimit: '2',
timeoutSeconds: 300,
});
console.log(speculatedServiceName); // remotion--3-3-96--mem2gi--cpu2-0--t-300
An object with the following properties:
memoryLimitThe upper bound on the amount of RAM that the Cloud Run service can consume.
cpuLimitThe maximum number of CPU cores that the Cloud Run service can use to process requests.
timeoutSecondsThe timeout that has been assigned to the Cloud Run service.
A string with the speculated name of the service.
deployService(): npx remotion cloudrun services deploy