diff --git a/deployment/live/example-gcp/ci/terragrunt.hcl b/deployment/live/example-gcp/ci/terragrunt.hcl index 0fe25b557..b13c4908c 100644 --- a/deployment/live/example-gcp/ci/terragrunt.hcl +++ b/deployment/live/example-gcp/ci/terragrunt.hcl @@ -1,5 +1,5 @@ terraform { - source = "${get_repo_root()}/deployment/modules/example-gcp" + source = "${get_repo_root()}/deployment/modules//example-gcp" } include "root" { @@ -10,7 +10,7 @@ include "root" { inputs = merge( include.root.locals, { - example_docker_image = "todo" + example_gcp_docker_image = "todo" } ) diff --git a/deployment/live/example-gcp/terragrunt.hcl b/deployment/live/example-gcp/terragrunt.hcl index be74a4f6a..853369799 100644 --- a/deployment/live/example-gcp/terragrunt.hcl +++ b/deployment/live/example-gcp/terragrunt.hcl @@ -1,5 +1,5 @@ terraform { - source = "${get_repo_root()}/deployment/modules/example-gcp" + source = "${get_repo_root()}/deployment/modules//example-gcp" } locals { diff --git a/deployment/modules/example-gcp/main.tf b/deployment/modules/example-gcp/main.tf index c0fbbba3f..8dd732e8d 100644 --- a/deployment/modules/example-gcp/main.tf +++ b/deployment/modules/example-gcp/main.tf @@ -3,7 +3,12 @@ terraform { } module "gcp" { - source = "../" + source = "..//gcp" + + base_name = var.base_name + env = var.env + location = var.location + project_id = var.project_id } ### @@ -24,9 +29,9 @@ resource "google_project_iam_member" "iam_metrics_writer" { role = "roles/monitoring.metricWriter" member = "serviceAccount:${google_service_account.cloudrun_service_account.email}" } -resource "google_project_iam_member" "iam_sql_client" { +resource "google_project_iam_member" "iam_spanner_client" { project = var.project_id - role = "roles/cloudsql.client" + role = "roles/spanner.client" member = "serviceAccount:${google_service_account.cloudrun_service_account.email}" } resource "google_project_iam_member" "iam_service_agent" { @@ -34,11 +39,6 @@ resource "google_project_iam_member" "iam_service_agent" { role = "roles/run.serviceAgent" member = "serviceAccount:${google_service_account.cloudrun_service_account.email}" } -resource "google_project_iam_member" "iam_secret_accessor" { - project = var.project_id - role = "roles/secretmanager.secretAccessor" - member = "serviceAccount:${google_service_account.cloudrun_service_account.email}" -} resource "google_cloud_run_v2_service" "default" { name = "example-service-${var.env}" @@ -53,8 +53,8 @@ resource "google_cloud_run_v2_service" "default" { args = [ "--logtostderr", "--v=1", - "--bucket=${modules.infra.outputs.log_bucket}", - "--spanner=${modules.infra.outputs.log_spanner}", + "--bucket=${module.gcp.log_bucket}", + "--spanner=${module.gcp.log_spanner}", "--project=${var.project_id}", "--signer=./testgcp.sec", ] @@ -80,13 +80,10 @@ resource "google_cloud_run_v2_service" "default" { } client = "terraform" depends_on = [ - google_project_service.secretmanager_api, - google_project_service.spanner_api, google_project_iam_member.iam_act_as, google_project_iam_member.iam_metrics_writer, google_project_iam_member.iam_spanner_client, google_project_iam_member.iam_service_agent, - google_project_iam_member.iam_secret_accessor, ] }