From 0d66cf9aa2570fb7c893758e23846ea12517234c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Lev=C3=A9e?= Date: Thu, 22 Feb 2024 15:44:52 +0100 Subject: [PATCH 1/6] feat(dns): add suffix to composer dns zone In case of multiple composer instance --- modules/composer_net/dns.tf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/composer_net/dns.tf b/modules/composer_net/dns.tf index 1bbbbcc4..842f2a24 100644 --- a/modules/composer_net/dns.tf +++ b/modules/composer_net/dns.tf @@ -16,8 +16,13 @@ composer.cloud.google.com ***************************************/ +resource "random_string" "composer_cloud_zone" { + length = 4 + special = false +} + resource "google_dns_managed_zone" "composer_cloud_zone" { - name = "composer-google-cloud-dns" + name = "composer-google-cloud-dns-${random_string.composer_cloud_zone.id}" project = var.network_project_id dns_name = "composer.cloud.google.com." description = "composer.cloud.google.com zone" From 7f5e84507381eb0177ec11d14c01d25bb030b17f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Lev=C3=A9e?= Date: Thu, 22 Feb 2024 15:49:06 +0100 Subject: [PATCH 2/6] fix(dns): force lower --- modules/composer_net/dns.tf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/composer_net/dns.tf b/modules/composer_net/dns.tf index 842f2a24..9a857eb8 100644 --- a/modules/composer_net/dns.tf +++ b/modules/composer_net/dns.tf @@ -17,8 +17,9 @@ composer.cloud.google.com ***************************************/ resource "random_string" "composer_cloud_zone" { - length = 4 - special = false + length = 4 + special = false + lower = true } resource "google_dns_managed_zone" "composer_cloud_zone" { From 5a0005b1680457ad939e9b8ec2ef3a60130e7ded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Lev=C3=A9e?= Date: Thu, 22 Feb 2024 15:51:06 +0100 Subject: [PATCH 3/6] fix(dns): force lower --- modules/composer_net/dns.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/composer_net/dns.tf b/modules/composer_net/dns.tf index 9a857eb8..0b3b9ed3 100644 --- a/modules/composer_net/dns.tf +++ b/modules/composer_net/dns.tf @@ -19,7 +19,7 @@ composer.cloud.google.com resource "random_string" "composer_cloud_zone" { length = 4 special = false - lower = true + upper = false } resource "google_dns_managed_zone" "composer_cloud_zone" { From acbba65ccb9f93b5ea4c1b88efaa9d5736d3d7c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Lev=C3=A9e?= Date: Thu, 22 Feb 2024 16:02:19 +0100 Subject: [PATCH 4/6] feat(dns): add variable for dns zone name --- modules/composer_net/dns.tf | 8 +------- modules/composer_net/variables.tf | 6 ++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/composer_net/dns.tf b/modules/composer_net/dns.tf index 0b3b9ed3..85b2fdc6 100644 --- a/modules/composer_net/dns.tf +++ b/modules/composer_net/dns.tf @@ -16,14 +16,8 @@ composer.cloud.google.com ***************************************/ -resource "random_string" "composer_cloud_zone" { - length = 4 - special = false - upper = false -} - resource "google_dns_managed_zone" "composer_cloud_zone" { - name = "composer-google-cloud-dns-${random_string.composer_cloud_zone.id}" + name = var.dns_zone_name project = var.network_project_id dns_name = "composer.cloud.google.com." description = "composer.cloud.google.com zone" diff --git a/modules/composer_net/variables.tf b/modules/composer_net/variables.tf index 43bc352c..f4970c98 100644 --- a/modules/composer_net/variables.tf +++ b/modules/composer_net/variables.tf @@ -71,3 +71,9 @@ variable "composer_env_name" { description = "Name of Cloud Composer Environment" type = string } + +variable "dns_zone_name" { + description = "Composer DNS private zone name" + type = string + default = "composer-google-cloud-dns" +} \ No newline at end of file From b15c73887a94b18efb2ed71b8610b63fd865b3b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Lev=C3=A9e?= Date: Fri, 8 Mar 2024 16:56:18 +0100 Subject: [PATCH 5/6] chore: fix terraform lint --- modules/composer_net/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/composer_net/variables.tf b/modules/composer_net/variables.tf index f4970c98..f90c52d4 100644 --- a/modules/composer_net/variables.tf +++ b/modules/composer_net/variables.tf @@ -76,4 +76,4 @@ variable "dns_zone_name" { description = "Composer DNS private zone name" type = string default = "composer-google-cloud-dns" -} \ No newline at end of file +} From df1bf1308e0b024a05b2bc9bcefc8f0298dd5a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Lev=C3=A9e?= Date: Tue, 29 Oct 2024 15:35:06 +0100 Subject: [PATCH 6/6] chore(composer_net): add inputs documentation --- modules/composer_net/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/composer_net/README.md b/modules/composer_net/README.md index ead485eb..ac3dd9bd 100644 --- a/modules/composer_net/README.md +++ b/modules/composer_net/README.md @@ -9,6 +9,7 @@ This example illustrates how to use the `composer-net` module. Please see exampl |------|-------------|------|---------|:--------:| | cloud\_composer\_network\_ipv4\_cidr\_block | The CIDR block from which IP range in tenant project will be reserved. | `string` | `null` | no | | composer\_env\_name | Name of Cloud Composer Environment | `string` | n/a | yes | +| dns\_zone\_name | Composer DNS private zone name | `string` | `"composer-google-cloud-dns"` | no | | gke\_pods\_services\_ip\_ranges | The secondary IP ranges for the GKE Pods and Services IP ranges | `list(string)` | n/a | yes | | gke\_subnet\_ip\_range | The GKE subnet IP range | `list(string)` | n/a | yes | | master\_ipv4\_cidr | The CIDR block from which IP range in tenant project will be reserved for the master. | `string` | `null` | no |