Infra & Cloud terraform Advanced

GCP Cloud Run Terraform

Deploy a containerised service to Google Cloud Run with traffic management via Terraform.

terraform
resource "google_cloud_run_service" "app" {
  name     = var.service_name
  location = var.region
  template {
    spec {
      containers {
        image = var.image
        resources { limits = { cpu = "1000m", memory = "512Mi" } }
      }
    }
  }
  traffic { percent = 100; latest_revision = true }
}

Prerequisites

  • terraform >= 1.0
  • google provider
  • GCP project

Pro Tips

  • → Set min-instances to 1 to avoid cold starts.

Was this module useful?

Share your experience — it helps the team improve.

Leave Feedback

Commercial Licensing

Acquire a production access token or template license for enterprise deployment.

Module Info

Language
terraform
Level
Advanced
Read time
5 min
Published
Dec 2024
License
Commercial License

Newsletter

New modules every week, directly to your inbox.