Skip to main content

deleteService()

EXPERIMENTAL

Cloud Run is in Alpha, which means APIs may change in any version and documentation is not yet finished. See the changelog to stay up to date with breaking changes.

Deletes a deployed Cloud Run service based on its name.

To retrieve a list of services, call getServices() first.

Example

ts
import { deleteService, getServices } from "@remotion/cloudrun";
 
const services = await getServices({
region: "us-east1",
compatibleOnly: false,
});
for (const service of services) {
await deleteService({
region: "us-east1",
serviceName: service.serviceName,
});
}
ts
import { deleteService, getServices } from "@remotion/cloudrun";
 
const services = await getServices({
region: "us-east1",
compatibleOnly: false,
});
for (const service of services) {
await deleteService({
region: "us-east1",
serviceName: service.serviceName,
});
}

Arguments

An object with the following properties:

region

The GCP region to which the service was deployed to.

serviceName

The name of the service to be deleted.

Return value

Nothing. If the deletion failed, the service rejects with an error.

See also