Skip to main content
Google Cloud Run is a serverless compute platform that lets you run containers without managing servers. It automatically scales up or down based on traffic, integrates with other GCP services, and supports deployments in multiple regions. Cloud Run abstracts away infrastructure management, allowing you to focus on your application logic.

Example

To create the GCPCloudRunHandler, pass Google service account credentials (either JSON file path or dict).
get_attr:
Safely fetches an attribute, dict key, or list index with a default fallback.
get_nested_attr:
Fetches nested attributes safely using a path list.
client (property):
Lazy initialization of the async Cloud Run client.
close:
Closes the async client to free resources.
_process_container_info:
Extracts metadata for a Cloud Run container (image, ports, env vars, resources).
_process_service_info:
Processes a Cloud Run service object into a structured dictionary.
_fetch_services_for_location:
Fetches all Cloud Run services in a specific region.
fetch_location_with_semaphore:
Helper method to fetch services from a location with concurrency limits.
get_gcp_cloud_run_details:
Lists all Cloud Run services across all supported GCP regions with summary.