In Application Design Center, you can configure a
Cloud Run service to run
stateless containers directly on Google's scalable, fully managed
infrastructure. You can customize the service for your specific component
connections and configuration parameters. The configuration parameters are
listed in the
terraform-google-cloud-run
Terraform module on GitHub.
Component connections
The following table includes the components that you can connect to a Cloud Run service, and the resulting updates to your application and its generated Terraform code.
| Connected component | Application updates | Background information |
|---|---|---|
| Secret Manager |
|
Configure secrets for services |
|
Authenticating service-to-service | |
| AlloyDB for PostgreSQL |
|
Connect from Cloud Run |
| BigQuery |
|
BigQuery overview |
|
Bigtable overview | |
Another Cloud Run service |
|
What is Cloud Run |
|
Connect from Cloud Run | |
|
Connect from Cloud Run | |
|
Connect to Google Cloud services | |
|
Set up a global external Application Load Balancer with Cloud Run | |
|
Connecting to a Redis instance from a Cloud Run service | |
|
Connect to a Memorystore for Redis Cluster instance | |
|
Connect to a Memorystore for Valkey instance | |
|
Use Pub/Sub with Cloud Run tutorial | |
|
Set up a regional external Application Load Balancer with Cloud Run | |
|
Forwarding rules overview | |
|
Connect to Google Cloud services | |
|
Host AI apps and agents on Cloud Run |
Required configuration parameters
If your template includes a Cloud Run component, you must configure the following parameters before you deploy.
| Parameter name | Description and constraints | Background information |
|---|---|---|
Project ID |
The project where you want to deploy the Cloud Run resource. |
Configure components |
Region |
The Cloud Run service deployment location. |
Cloud Run locations |
Service Name |
name | Cloud Run service |
Optional configuration parameters
The following parameters are optional. To display advanced parameters, in the Configuration area, select Show advanced fields.
| Feature | Parameter name | Description and constraint information | Background information |
|---|---|---|---|
| Containers | Container Name |
name | Building containers |
| Containers | Container Image |
image | Deploying container images to Cloud Run |
| Containers | Working Dir |
The container's working directory. If not specified, the container runtime's default is used, which might be configured in the container image. |
workingDir |
| Containers | Depends on Container |
dependsOn[] | Configure container start order for sidecar deployments |
| Containers | Container Args |
args[] | Configure containers for services |
| Containers | Container Command |
command | Configure containers for services |
| Containers: Env Vars | Key |
name | Environment variables for services |
| Containers: Env Vars | Value |
value | Environment variables for services |
| Containers: Env Secret Vars | Key |
EnvVarSource | Make a secret accessible to Cloud Run |
| Containers: Env Secret Vars | Secret |
secret | Make a secret accessible to Cloud Run |
| Containers: Env Secret Vars | Version |
version | Make a secret accessible to Cloud Run |
| Containers: Volume Mounts | Name |
name | Connect from Cloud Run |
| Containers: Volume Mounts | Mount Path |
mountPath | Connect from Cloud Run |
| Containers: Ports | Name |
name | Use HTTP/2 for services |
| Containers: Ports | Container Port |
containerPort | Use HTTP/2 for services |
| Containers: Resources | CPU |
limits | Configure CPU limits for services |
| Containers: Resources | Memory |
limits | Configure memory limits for services |
| Containers: Resources | CPU Idle |
Whether CPU is only allocated during requests. |
cpuIdle |
| Containers: Resources | Startup CPU Boost |
startupCPUBoost | Set startup CPU boost |
| Containers: Startup Probe | Failure Threshold |
failureThreshold | Configure container health checks for services |
| Containers: Startup Probe | Initial Delay Seconds |
initialDelaySeconds | Configure startup probes |
| Containers: Startup Probe | Timeout Seconds |
timeoutSeconds | Configure startup probes |
| Containers: Startup Probe | Period Seconds |
periodSeconds | Configure startup probes |
| Containers: Startup Probe | HTTP Get Path |
path | Configure startup probes |
| Containers: Startup Probe | HTTP Get Port |
port | Configure startup probes |
| Containers: Startup Probe | HTTP Headers Name |
name | Configure startup probes |
| Containers: Startup Probe | HTTP Headers Value |
value | Configure startup probes |
| Containers: Startup Probe | TCP Socket Port |
port | The default TCP startup probe |
| Containers: Startup Probe | GRPC Port |
port | Configure startup probes |
| Containers: Startup Probe | GRPC Service |
service | Configure startup probes |
| Containers | Liveness Probe |
livenessProbe | Use cases |
Description |
description | Set service descriptions | |
Create Service Account |
Create a new service account for the Cloud Run service. |
Configure service identity for services | |
Service Account Project Roles |
Roles to grant to the newly created service account. Enable Create Service Account and don't provide input for Service Account. |
Configure service identity for services | |
Ingress |
IngressTraffic | Restrict network ingress for Cloud Run | |
Members |
Users and service accounts that can invoke the service. For public access, enter |
Manage access to services | |
| VPC Access | Connector |
connector | VPC with connectors |
| VPC Access | Egress | egress | Control egress service traffic |
| VPC Access: Network Interfaces | Network | network | Deploy a service |
| VPC Access: Network Interfaces | Subnetwork | subnetwork | Deploy a service |
| VPC Access: Network Interfaces | Tags | tags | Deploy a service |
Cloud Run Deletion Protection |
Prevents Terraform from destroying or recreating Cloud Run jobs and services. |
deletion_protection | |
Enable Prometheus Sidecar |
Enable the Prometheus sidecar in the Cloud Run service. |
Write Prometheus metrics by using the Prometheus sidecar | |
| Volumes | Name |
name | Configure an in-memory volume |
| Volumes: Secret | Secret | secret | Make a secret accessible to Cloud Run |
| Volumes: Secret | Default Mode | defaultMode | Make a secret accessible to Cloud Run |
| Volumes: Secret | Path | path | Make a secret accessible to Cloud Run |
| Volumes: Secret | Version | version | Make a secret accessible to Cloud Run |
| Volumes: Secret | Mode | mode | Make a secret accessible to Cloud Run |
| Volumes: Cloud SQL Instance | Instances | instances[] | Connect from Cloud Run |
| Volumes: Empty Dir | Medium | medium | Configure in-memory volume mounts for services |
| Volumes: Empty Dir | Size Limit | sizeLimit | Configure in-memory volume mounts for services |
| Volumes: GCS | Bucket | bucket | Configure Cloud Storage volume mounts for services |
| Volumes: GCS | Read Only | readOnly | Configure Cloud Storage volume mounts for services |
| Volumes: NFS | Server | server | Configure NFS volume mounts for services |
| Volumes: NFS | Path | path | Configure NFS volume mounts for services |
| Volumes: NFS | Read Only | readOnly | Configure NFS volume mounts for services |
| Service Scaling | Min Instance Count |
minInstanceCount | Set minimum instances for services |
Revision |
revision | Cloud Run service revisions | |
| Template Scaling | Min Instance Count |
minInstanceCount | Set minimum instances for services |
| Template Scaling | Max Instance Count | maxInstanceCount | About maximum instances |
Encryption Key |
encryptionKey | Using customer managed encryption keys | |
Max Instance Request Concurrency |
maxInstanceRequestConcurrency | Maximum concurrent requests for services | |
Session Affinity |
sessionAffinity | Set session affinity for services | |
Execution Environment |
executionEnvironment | About service execution environments | |
| Traffic | Type |
type | Rollbacks, gradual rollouts, and traffic migration |
| Traffic | Percent | percent | Rollbacks, gradual rollouts, and traffic migration |
| Traffic | Revision | revision | Rollbacks, gradual rollouts, and traffic migration |
| Traffic | Tag | tag | Rollbacks, gradual rollouts, and traffic migration |
| Service Labels | Key |
labels | Configure labels for services |
| Service Labels | Value | labels | Configure labels for services |
| Service Annotations | Key |
annotations | annotations |
| Service Annotations | Value | annotations | annotations |
| Client | Name |
Arbitrary identifier for the API client. |
client |
| Client | Version | Arbitrary identifier for the API client version. |
clientVersion |
Launch Stage |
LaunchStage | Product launch stages | |
Custom Audiences |
customAudience | Set custom audiences for services | |
| Binary Authorization | Breakglass Justification |
breakglassJustification | Use breakglass |
| Binary Authorization | Use Default | useDefault | Use Binary Authorization |
| Template Labels | Key |
labels | Configuring labels for services |
| Template Labels | Value | labels | Configuring labels for services |
| Template Annotations | Key |
annotations | annotations |
| Template Annotations | Value | annotations | annotations |
Timeout |
timeout | Set request timeout for services | |
Service Account |
serviceAccount | Configure service identity for services |