Add Terraform configuration files for Cloud Run service deployment
This commit is contained in:
41
terraform/main.tf
Normal file
41
terraform/main.tf
Normal file
@@ -0,0 +1,41 @@
|
||||
# Create Cloud Run service
|
||||
resource "google_cloud_run_v2_service" "jppg" {
|
||||
name = "jmespath-playground"
|
||||
location = var.default_region
|
||||
invoker_iam_disabled = true
|
||||
|
||||
template {
|
||||
containers {
|
||||
image = "skoszewski/jmespath-playground:${var.image_version}"
|
||||
name = "jmespath-playground-1"
|
||||
ports {
|
||||
container_port = 3000
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scaling {
|
||||
max_instance_count = 1
|
||||
}
|
||||
|
||||
deletion_protection = var.deletion_protection
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [
|
||||
client
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
resource "google_cloud_run_domain_mapping" "jppg" {
|
||||
name = "jmespath-playground.gcp-lab.koszewscy.waw.pl"
|
||||
location = var.default_region
|
||||
|
||||
spec {
|
||||
route_name = google_cloud_run_v2_service.jppg.name
|
||||
}
|
||||
|
||||
metadata {
|
||||
namespace = var.project_id
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user