diff --git a/deployment/live/example-gcp/main.tf b/deployment/live/example-gcp/main.tf deleted file mode 100644 index 11d396e32..000000000 --- a/deployment/live/example-gcp/main.tf +++ /dev/null @@ -1,67 +0,0 @@ -terraform { - backend "gcs" { - bucket = "bucket-tfstate" - prefix = "example-gcs/terraform.tfstate" - } -} - -provider "google" { - project = var.project_id -} - -# Serivices & APIs - -resource "google_project_service" "cloudkms_googleapis_com" { - service = "cloudkms.googleapis.com" -} - -# Remote state -resource "google_kms_key_ring" "terraform_state" { - name = "bucket-tfstate" - location = var.location -} - -resource "google_kms_crypto_key" "terraform_state_bucket" { - name = "terraform-state-bucket" - key_ring = google_kms_key_ring.terraform_state.id -} - -resource "google_storage_bucket" "terraform_state" { - name = "bucket-tfstate" - force_destroy = false - location = var.location - storage_class = "STANDARD" - versioning { - enabled = true - } - encryption { - default_kms_key_name = google_kms_crypto_key.terraform_state_bucket.id - } - uniform_bucket_level_access = true -} - - -data "terraform_remote_state" "log" { - backend = "gcs" - workspace = terraform.workspace - config = { - bucket = "bucket-tfstate" - prefix = "example-gcs/terraform.tfstate" - } -} - -# Log instance - -data "google_project" "project" { - project_id = var.project_id -} - -module "gcs-log" { - source = "../../modules/gcs" - - base_name = var.base_name - project_id = var.project_id - location = var.location -} - - diff --git a/deployment/live/example-gcp/terraform.tfvars b/deployment/live/example-gcp/terraform.tfvars deleted file mode 100644 index f74b29591..000000000 --- a/deployment/live/example-gcp/terraform.tfvars +++ /dev/null @@ -1,2 +0,0 @@ -base_name = "example-gcs" -location = "us-central1" diff --git a/deployment/live/example-gcp/terragrunt.hcl b/deployment/live/example-gcp/terragrunt.hcl new file mode 100644 index 000000000..a68fd2fd1 --- /dev/null +++ b/deployment/live/example-gcp/terragrunt.hcl @@ -0,0 +1,23 @@ +terraform { + source = "${get_repo_root()}/deployment/modules/gcs-log" +} + +locals { + project_id = "trillian-tessera" + location = "us-central1" + base_name = "example-gcs" +} + +remote_state { + backend = "gcs" + + config = { + project = local.project_id + location = local.location + bucket = "${local.project_id}-${local.base_name}-terraform-state" + + gcs_bucket_labels = { + name = "terraform_state_storage" + } + } +} diff --git a/deployment/live/example-gcp/variables.tf b/deployment/live/example-gcp/variables.tf deleted file mode 100644 index fa8142e7a..000000000 --- a/deployment/live/example-gcp/variables.tf +++ /dev/null @@ -1,14 +0,0 @@ -variable "project_id" { - description = "GCP project ID where the log is hosted" - type = string -} - -variable "base_name" { - description = "Base name to use when naming resources" - type = string -} - -variable "location" { - description = "Location in which to create resources" - type = string -}