From a982dee059f112a46f10437c95f60fa5aff137fb Mon Sep 17 00:00:00 2001 From: Philippe Boneff Date: Wed, 24 Jul 2024 14:23:02 +0000 Subject: [PATCH 1/8] read environment variables --- deployment/live/example-gcp/terragrunt.hcl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deployment/live/example-gcp/terragrunt.hcl b/deployment/live/example-gcp/terragrunt.hcl index 46fcce6e..4cb97e50 100644 --- a/deployment/live/example-gcp/terragrunt.hcl +++ b/deployment/live/example-gcp/terragrunt.hcl @@ -3,9 +3,9 @@ terraform { } locals { - project_id = "trillian-tessera" - location = "us-central1" - base_name = "example-gcp" + project_id = get_env("GOOGLE_PROJECT") + location = get_env("GOOGLE_REGION", "us-central1") + base_name = get_env("TESSERA_BASE_NAME", "trillian-tessera") } inputs = merge( From b7da2d5094ed07fd1df553190b40ca9ef3c93e4e Mon Sep 17 00:00:00 2001 From: Philippe Boneff Date: Wed, 24 Jul 2024 14:31:03 +0000 Subject: [PATCH 2/8] add instructions --- deployment/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/deployment/README.md b/deployment/README.md index e010cc85..d651c787 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -20,6 +20,18 @@ the project: gcloud auth application-default login ``` +Then, specify your Google Cloud project ID: +```bash +export GOOGLE_PROJECT={VALUE} +``` + +Eventually, customize the region (defaults to "us-east1"), and bucket name prefix +(defaults to "trillian-tessera"): +```bash +export GOOGLE_REGION={VALUE} +export TESSERA_BASE_NAME={VALUE} +``` + Terraforming the project can be done by: 1. `cd` to the relevant `live` directory for the environment to deploy/change 2. Run `terragrunt apply` From 9c7b31be899e5a3b0b9b98d344357f67beee7375 Mon Sep 17 00:00:00 2001 From: Philippe Boneff Date: Wed, 24 Jul 2024 16:40:24 +0000 Subject: [PATCH 3/8] s/trillian-tessera/tessera because otherwise names are too long --- deployment/README.md | 2 +- deployment/live/example-gcp/terragrunt.hcl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/README.md b/deployment/README.md index d651c787..2b54ef5e 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -26,7 +26,7 @@ export GOOGLE_PROJECT={VALUE} ``` Eventually, customize the region (defaults to "us-east1"), and bucket name prefix -(defaults to "trillian-tessera"): +(defaults to "tessera"): ```bash export GOOGLE_REGION={VALUE} export TESSERA_BASE_NAME={VALUE} diff --git a/deployment/live/example-gcp/terragrunt.hcl b/deployment/live/example-gcp/terragrunt.hcl index 4cb97e50..b94b03da 100644 --- a/deployment/live/example-gcp/terragrunt.hcl +++ b/deployment/live/example-gcp/terragrunt.hcl @@ -5,7 +5,7 @@ terraform { locals { project_id = get_env("GOOGLE_PROJECT") location = get_env("GOOGLE_REGION", "us-central1") - base_name = get_env("TESSERA_BASE_NAME", "trillian-tessera") + base_name = get_env("TESSERA_BASE_NAME", "tessera") } inputs = merge( From 739081d710ff3194f4a1f9ed449716c919609ce7 Mon Sep 17 00:00:00 2001 From: Philippe Boneff Date: Wed, 24 Jul 2024 16:52:26 +0000 Subject: [PATCH 4/8] better names and move documentation around --- deployment/README.md | 22 +------------------- deployment/live/example-gcp/README.md | 24 ++++++++++++++++++++++ deployment/live/example-gcp/terragrunt.hcl | 2 +- deployment/modules/gcs/main.tf | 2 +- 4 files changed, 27 insertions(+), 23 deletions(-) create mode 100644 deployment/live/example-gcp/README.md diff --git a/deployment/README.md b/deployment/README.md index 2b54ef5e..f95cee5d 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -14,25 +14,5 @@ Deploying these examples requires installation of: ## Deploying -First authenticate via `gcloud` as a principle with sufficient ACLs for -the project: -```bash -gcloud auth application-default login -``` - -Then, specify your Google Cloud project ID: -```bash -export GOOGLE_PROJECT={VALUE} -``` - -Eventually, customize the region (defaults to "us-east1"), and bucket name prefix -(defaults to "tessera"): -```bash -export GOOGLE_REGION={VALUE} -export TESSERA_BASE_NAME={VALUE} -``` - -Terraforming the project can be done by: - 1. `cd` to the relevant `live` directory for the environment to deploy/change - 2. Run `terragrunt apply` +See individual `live` subdirectories. diff --git a/deployment/live/example-gcp/README.md b/deployment/live/example-gcp/README.md new file mode 100644 index 00000000..b009a5fb --- /dev/null +++ b/deployment/live/example-gcp/README.md @@ -0,0 +1,24 @@ +## Deployment + +First authenticate via `gcloud` as a principle with sufficient ACLs for +the project: +```bash +gcloud auth application-default login +``` + +Then, specify your Google Cloud project ID: +```bash +export GOOGLE_PROJECT={VALUE} +``` + +Eventually, customize the region (defaults to "us-east1"), and bucket name prefix +(defaults to "tessera-example"): +```bash +export GOOGLE_REGION={VALUE} +export TESSERA_BASE_NAME={VALUE} +``` + +Terraforming the project can be done by: + 1. `cd` to the relevant `live` directory for the environment to deploy/change + 2. Run `terragrunt apply` + diff --git a/deployment/live/example-gcp/terragrunt.hcl b/deployment/live/example-gcp/terragrunt.hcl index b94b03da..5e5599ac 100644 --- a/deployment/live/example-gcp/terragrunt.hcl +++ b/deployment/live/example-gcp/terragrunt.hcl @@ -5,7 +5,7 @@ terraform { locals { project_id = get_env("GOOGLE_PROJECT") location = get_env("GOOGLE_REGION", "us-central1") - base_name = get_env("TESSERA_BASE_NAME", "tessera") + base_name = get_env("TESSERA_BASE_NAME", "tessera-example") } inputs = merge( diff --git a/deployment/modules/gcs/main.tf b/deployment/modules/gcs/main.tf index 6f2fd339..c5d819a5 100644 --- a/deployment/modules/gcs/main.tf +++ b/deployment/modules/gcs/main.tf @@ -52,7 +52,7 @@ resource "google_storage_bucket_iam_binding" "log_bucket_writer" { resource "google_spanner_instance" "log_spanner" { name = var.base_name config = "regional-${var.location}" - display_name = "${var.base_name} Spanner Instance" + display_name = "${var.base_name}" processing_units = 100 } From aed8e5e103569dd43cf7731f65adb80f1b32a5f8 Mon Sep 17 00:00:00 2001 From: Philippe Boneff Date: Thu, 25 Jul 2024 12:37:35 +0000 Subject: [PATCH 5/8] s/us-east1/us-central1 --- deployment/live/example-gcp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/live/example-gcp/README.md b/deployment/live/example-gcp/README.md index b009a5fb..1fb0c01c 100644 --- a/deployment/live/example-gcp/README.md +++ b/deployment/live/example-gcp/README.md @@ -11,7 +11,7 @@ Then, specify your Google Cloud project ID: export GOOGLE_PROJECT={VALUE} ``` -Eventually, customize the region (defaults to "us-east1"), and bucket name prefix +Eventually, customize the region (defaults to "us-central1"), and bucket name prefix (defaults to "tessera-example"): ```bash export GOOGLE_REGION={VALUE} From 463ba5920049008719bc369027c32e3944567168 Mon Sep 17 00:00:00 2001 From: Philippe Boneff Date: Thu, 25 Jul 2024 13:20:16 +0000 Subject: [PATCH 6/8] leave defaults set to current values --- deployment/live/example-gcp/terragrunt.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/live/example-gcp/terragrunt.hcl b/deployment/live/example-gcp/terragrunt.hcl index 5e5599ac..af6e117b 100644 --- a/deployment/live/example-gcp/terragrunt.hcl +++ b/deployment/live/example-gcp/terragrunt.hcl @@ -3,9 +3,9 @@ terraform { } locals { - project_id = get_env("GOOGLE_PROJECT") + project_id = get_env("GOOGLE_PROJECT", "trillian-example") location = get_env("GOOGLE_REGION", "us-central1") - base_name = get_env("TESSERA_BASE_NAME", "tessera-example") + base_name = get_env("TESSERA_BASE_NAME", "example-gcp") } inputs = merge( From 57bfc128e2d92a7bccda9a251f66830bfd8d4603 Mon Sep 17 00:00:00 2001 From: Philippe Boneff Date: Thu, 25 Jul 2024 14:06:18 +0000 Subject: [PATCH 7/8] tidy things up --- deployment/live/example-gcp/README.md | 6 +++--- deployment/live/example-gcp/terragrunt.hcl | 2 +- deployment/modules/gcs/main.tf | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deployment/live/example-gcp/README.md b/deployment/live/example-gcp/README.md index 1fb0c01c..1028d0e2 100644 --- a/deployment/live/example-gcp/README.md +++ b/deployment/live/example-gcp/README.md @@ -6,13 +6,13 @@ the project: gcloud auth application-default login ``` -Then, specify your Google Cloud project ID: +Set your GCP project ID with: ```bash export GOOGLE_PROJECT={VALUE} ``` -Eventually, customize the region (defaults to "us-central1"), and bucket name prefix -(defaults to "tessera-example"): +Eventually, customize the GCP region (defaults to "us-central1"), +and bucket name prefix (defaults to "example-gcp"): ```bash export GOOGLE_REGION={VALUE} export TESSERA_BASE_NAME={VALUE} diff --git a/deployment/live/example-gcp/terragrunt.hcl b/deployment/live/example-gcp/terragrunt.hcl index af6e117b..3ec9d58a 100644 --- a/deployment/live/example-gcp/terragrunt.hcl +++ b/deployment/live/example-gcp/terragrunt.hcl @@ -3,7 +3,7 @@ terraform { } locals { - project_id = get_env("GOOGLE_PROJECT", "trillian-example") + project_id = get_env("GOOGLE_PROJECT", "trillian-tessera") location = get_env("GOOGLE_REGION", "us-central1") base_name = get_env("TESSERA_BASE_NAME", "example-gcp") } diff --git a/deployment/modules/gcs/main.tf b/deployment/modules/gcs/main.tf index c5d819a5..6f2fd339 100644 --- a/deployment/modules/gcs/main.tf +++ b/deployment/modules/gcs/main.tf @@ -52,7 +52,7 @@ resource "google_storage_bucket_iam_binding" "log_bucket_writer" { resource "google_spanner_instance" "log_spanner" { name = var.base_name config = "regional-${var.location}" - display_name = "${var.base_name}" + display_name = "${var.base_name} Spanner Instance" processing_units = 100 } From 34fb0d2533c790fd6e3a42b67350d8e5c289ffcf Mon Sep 17 00:00:00 2001 From: Philippe Boneff Date: Thu, 25 Jul 2024 15:30:22 +0000 Subject: [PATCH 8/8] EnglishIsHard --- deployment/live/example-gcp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/live/example-gcp/README.md b/deployment/live/example-gcp/README.md index 1028d0e2..cb3394fc 100644 --- a/deployment/live/example-gcp/README.md +++ b/deployment/live/example-gcp/README.md @@ -11,7 +11,7 @@ Set your GCP project ID with: export GOOGLE_PROJECT={VALUE} ``` -Eventually, customize the GCP region (defaults to "us-central1"), +Optionally, customize the GCP region (defaults to "us-central1"), and bucket name prefix (defaults to "example-gcp"): ```bash export GOOGLE_REGION={VALUE}