diff --git a/deployment/live/example-gcp/terragrunt.hcl b/deployment/live/example-gcp/terragrunt.hcl deleted file mode 100644 index 0ce3c649e..000000000 --- a/deployment/live/example-gcp/terragrunt.hcl +++ /dev/null @@ -1,25 +0,0 @@ -terraform { - source = "${get_repo_root()}/deployment/modules//example-gcp" -} - -locals { - env = path_relative_to_include() - project_id = get_env("GOOGLE_PROJECT", "trillian-tessera") - location = get_env("GOOGLE_REGION", "us-central1") - base_name = get_env("TESSERA_BASE_NAME", "${path_relative_to_include()}-example-gcp") -} - -remote_state { - backend = "gcs" - - config = { - project = local.project_id - location = local.location - bucket = "${local.project_id}-${local.base_name}-terraform-state" - prefix = "${path_relative_to_include()}/terraform.tfstate" - - gcs_bucket_labels = { - name = "terraform_state_storage" - } - } -} diff --git a/deployment/live/gcp/example-gcp/ci/terragrunt.hcl b/deployment/live/gcp/example-gcp/ci/terragrunt.hcl index f478e5dea..341fd76bd 100644 --- a/deployment/live/gcp/example-gcp/ci/terragrunt.hcl +++ b/deployment/live/gcp/example-gcp/ci/terragrunt.hcl @@ -1,5 +1,5 @@ terraform { - source = "${get_repo_root()}/deployment/modules//example-gcp" + source = "${get_repo_root()}/deployment/modules/gcp//example-gcp" } include "root" { diff --git a/deployment/live/gcp/example-gcp/terragrunt.hcl b/deployment/live/gcp/example-gcp/terragrunt.hcl index e41c5fe7c..c1ed8e920 100644 --- a/deployment/live/gcp/example-gcp/terragrunt.hcl +++ b/deployment/live/gcp/example-gcp/terragrunt.hcl @@ -1,5 +1,5 @@ terraform { - source = "${get_repo_root()}/deployment/modules//gcp/example-gcp" + source = "${get_repo_root()}/deployment/modules/gcp//example-gcp" } locals { diff --git a/deployment/modules/example-gcp/main.tf b/deployment/modules/gcp/example-gcp/main.tf similarity index 92% rename from deployment/modules/example-gcp/main.tf rename to deployment/modules/gcp/example-gcp/main.tf index cf356593e..d925b464e 100644 --- a/deployment/modules/example-gcp/main.tf +++ b/deployment/modules/gcp/example-gcp/main.tf @@ -5,8 +5,8 @@ terraform { ## Call the Tessera GCP module ## ## This will configure all the storage infrastructure required to run a Tessera log on GCP. -module "gcp" { - source = "..//gcp" +module "gcs" { + source = "..//gcs" base_name = var.base_name env = var.env @@ -40,8 +40,8 @@ resource "google_project_iam_member" "iam_metrics_writer" { } resource "google_spanner_database_iam_binding" "iam_spanner_database_user" { project = var.project_id - instance = module.gcp.log_spanner_instance.name - database = module.gcp.log_spanner_db.name + instance = module.gcs.log_spanner_instance.name + database = module.gcs.log_spanner_db.name role = "roles/spanner.databaseUser" members = [ @@ -67,8 +67,8 @@ resource "google_cloud_run_v2_service" "default" { args = [ "--logtostderr", "--v=1", - "--bucket=${module.gcp.log_bucket.id}", - "--spanner=${module.gcp.log_spanner_db.id}", + "--bucket=${module.gcs.log_bucket.id}", + "--spanner=${module.gcs.log_spanner_db.id}", "--project=${var.project_id}", "--signer=./testgcp.sec", ] @@ -94,7 +94,7 @@ resource "google_cloud_run_v2_service" "default" { } client = "terraform" depends_on = [ - module.gcp, + module.gcs, google_project_service.cloudrun_api, google_project_iam_member.iam_act_as, google_project_iam_member.iam_metrics_writer, diff --git a/deployment/modules/example-gcp/variables.tf b/deployment/modules/gcp/example-gcp/variables.tf similarity index 100% rename from deployment/modules/example-gcp/variables.tf rename to deployment/modules/gcp/example-gcp/variables.tf