Skip to content

libops/terraform-cloudrun-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-cloudrun-v2

Terraform module for a multi-region Google Cloud Run v2 Service behind a serverless Network Endpoint Group (NEG).

Variables support GPUs, GCS mounts, multi-containers.

Requirements

Name Version
google ~> 7.0

Providers

Name Version
google ~> 7.0

Modules

No modules.

Resources

Name Type
google_cloud_run_v2_service.cloudrun resource
google_cloud_run_v2_service_iam_member.invoker resource
google_compute_backend_service.backend resource
google_compute_region_network_endpoint_group.neg resource
google_project_iam_member.sa_role resource
google_service_account.service_account resource
google_service_account.service_account data source

Inputs

Name Description Type Default Required
addl_env_vars Additional environment variables to set in containers
list(object({
name = string
value = string
}))
[] no
containers List of container configurations to run in the service. At least one container needs a port. This allows easily configuring multi-container deployments.
list(object({
image = string
name = string
command = optional(list(string), null)
args = optional(list(string), null)
port = optional(number, 0)
memory = optional(string, "512Mi")
cpu = optional(string, "1000m")
liveness_probe = optional(string, "")
gpus = optional(string, "")
volume_mounts = optional(list(object({
name = string
mount_path = string
})), [])
}))
n/a yes
empty_dir_volumes List of empty directory volumes to create and mount
list(object({
name = string
size_limit = optional(string, "2Mi")
}))
[] no
gcs_volumes List of Google Cloud Storage buckets to mount as volumes. Must ensure the Cloud Run GSA has proper IAM set on the bucket
list(object({
name = string
bucket = string
read_only = optional(bool, true)
}))
[] no
gsa Service account name the Cloud Run service will run as. If empty, creates a new one. string "" no
invokers List of members to grant Cloud Run invoker role list(string)
[
"allUsers"
]
no
max_instances Maximum number of instances to scale to string "100" no
min_instances Minimum number of instances to keep running string "0" no
name Name of the Cloud Run service string n/a yes
project The GCP project to use string n/a yes
regions The GCP region(s) to deploy to list(string)
[
"us-east4",
"us-east5",
"us-central1",
"us-west3",
"us-west1",
"us-west4",
"us-south1",
"northamerica-northeast1",
"northamerica-northeast2",
"northamerica-south1",
"australia-southeast1",
"australia-southeast2"
]
no
secrets List of Secret Manager secrets to mount as environment variables
list(object({
name = string
secret_id = string
secret_name = string
}))
[] no
skipNeg Skip creating Network Endpoint Group and Backend Service bool false no

Outputs

Name Description
backend Backend service ID for load balancer (empty if skipNeg is true)
gsa Name of the service account used by Cloud Run
gsaEmail Email address of the service account used by Cloud Run
name Map of region to Cloud Run service names
url Primary Cloud Run service URL (first region)
urls Map of region to Cloud Run service URLs

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •