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.
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.
Similar Modules
AWS S3 Static Website
Terraform module to provision an S3 bucket for static website hosting.
terraform
·
Intermediate
AWS RDS Postgres Terraform
Terraform resource for an RDS PostgreSQL instance with encryption and backup.
terraform
·
Intermediate
ECS Task Force Stop
Force-stop all running ECS tasks in a service for emergency rollback.
bash
·
Intermediate