Skip to content

Commit

Permalink
Update cloud-run.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
kjlippold authored Oct 14, 2024
1 parent 999793a commit 90e6e39
Showing 1 changed file with 28 additions and 35 deletions.
63 changes: 28 additions & 35 deletions terraform/gcp/cloud-run.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,39 @@
# HydroServer GCP Cloud Run Service #
# -------------------------------------------------- #

#resource "google_cloud_run_service" "hydroserver_api" {
# name = "hydroserver-api-${var.instance}"
# location = var.region
resource "google_cloud_run_service" "hydroserver_api" {
name = "hydroserver-api-${var.instance}"
location = var.region

# template {
# spec {
# containers {
# image = "gcr.io/cloudrun/hello"
# resources {
# limits = {
# memory = "512Mi"
# }
# }
# ports {
# container_port = 8080
# }
# }
# }
# }
template {
spec {
containers {
image = "gcr.io/cloudrun/hello"
resources {
limits = {
memory = "512Mi"
}
}
ports {
container_port = 8080
}
}
}
}

# traffic {
# percent = 100
# latest_revision = true
# }
#}
traffic {
percent = 100
latest_revision = true
}
}

# -------------------------------------------------- #
# HydroServer GCP Cloud Run Service Public Access #
# -------------------------------------------------- #

#resource "google_cloud_run_service_iam_member" "hydroserver_api_public_access" {
# service = google_cloud_run_service.hydroserver_api.name
# location = google_cloud_run_service.hydroserver_api.location
# role = "roles/run.invoker"
# member = "allUsers"
#}

resource "google_storage_bucket" "test_bucket" {
name = "hydroserver-test-bucket"
location = var.region
force_destroy = true
uniform_bucket_level_access = true
resource "google_cloud_run_service_iam_member" "hydroserver_api_public_access" {
service = google_cloud_run_service.hydroserver_api.name
location = google_cloud_run_service.hydroserver_api.location
role = "roles/run.invoker"
member = "allUsers"
}

0 comments on commit 90e6e39

Please sign in to comment.