From 4d526f930958027d546ef9109eba095553fe7409 Mon Sep 17 00:00:00 2001 From: Andrew Peabody Date: Tue, 19 Jul 2022 11:15:05 -0700 Subject: [PATCH] feat: add module_depends_on for asm sub module (#1323) --- modules/asm/README.md | 1 + modules/asm/main.tf | 2 +- modules/asm/variables.tf | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/asm/README.md b/modules/asm/README.md index 987cb3657..d37a185c6 100644 --- a/modules/asm/README.md +++ b/modules/asm/README.md @@ -60,6 +60,7 @@ To deploy this config: | enable\_vpc\_sc | Determines whether to enable VPC-SC for this ASM installation. For more information read https://cloud.google.com/service-mesh/docs/managed/vpc-sc | `bool` | `false` | no | | fleet\_id | The fleet to use for this ASM installation. | `string` | `""` | no | | internal\_ip | Use internal ip for the cluster endpoint when running kubectl commands. | `bool` | `false` | no | +| module\_depends\_on | List of modules or resources this module depends on. | `list(any)` | `[]` | no | | multicluster\_mode | [Preview] Determines whether remote secrets should be autogenerated across fleet cluster. | `string` | `"manual"` | no | | project\_id | The project in which the resource belongs. | `string` | n/a | yes | diff --git a/modules/asm/main.tf b/modules/asm/main.tf index 0f88922a3..31276b7c2 100644 --- a/modules/asm/main.tf +++ b/modules/asm/main.tf @@ -63,5 +63,5 @@ module "cpr" { kubectl_create_command = "${path.module}/scripts/create_cpr.sh ${local.revision_name} ${local.channel} ${var.enable_cni} ${var.enable_vpc_sc}" kubectl_destroy_command = "${path.module}/scripts/destroy_cpr.sh ${local.revision_name}" - module_depends_on = [kubernetes_config_map.asm_options] + module_depends_on = concat([kubernetes_config_map.asm_options], var.module_depends_on) } diff --git a/modules/asm/variables.tf b/modules/asm/variables.tf index 94560d8f9..ca0818ad1 100644 --- a/modules/asm/variables.tf +++ b/modules/asm/variables.tf @@ -92,3 +92,9 @@ variable "internal_ip" { type = bool default = false } + +variable "module_depends_on" { + description = "List of modules or resources this module depends on." + type = list(any) + default = [] +}