README.md
June 10, 2026 ยท View on GitHub
Description
This module deploys a Google Cloud Run (v2) service.
Example usage
- id: cloud_run
source: modules/compute/cloud-run
settings:
project_id: $(vars.project_id)
region: us-central1
service_name: my-service
image: us-docker.pkg.dev/cloudrun/container/hello
container_port: 8080
env_vars:
KEY: "VALUE"
allow_unauthenticated: true
License
Copyright 2026 Google LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Requirements
| Name | Version |
|---|---|
| terraform | >= 1.12.2 |
| >= 4.48.0 |
Providers
| Name | Version |
|---|---|
| >= 4.48.0 |
Modules
No modules.
Resources
| Name | Type |
|---|---|
| google_cloud_run_v2_service.default | resource |
| google_cloud_run_v2_service_iam_member.public_access | resource |
Inputs
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| allow_unauthenticated | Whether to allow unauthenticated access | bool | false | no |
| container_port | Port the container listens on | number | 8080 | no |
| deletion_protection | Whether to enable deletion protection for the Cloud Run service | bool | true | no |
| env_vars | Environment variables for the container | map(string) | {} | no |
| image | Container Image URL | string | n/a | yes |
| ingress | Ingress traffic allowed for the service. Possible values: INGRESS_TRAFFIC_ALL, INGRESS_TRAFFIC_INTERNAL_ONLY, INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER. | string | "INGRESS_TRAFFIC_ALL" | no |
| labels | Labels to apply to the Cloud Run service | any | {} | no |
| project_id | GCP Project ID | string | n/a | yes |
| region | GCP Region | string | n/a | yes |
| service_name | Cloud Run Service Name | string | n/a | yes |
Outputs
| Name | Description |
|---|---|
| service_name | The Name of the Cloud Run service |
| service_url | The URL of the Cloud Run service |