From 35b2bf510232c72ccabfebcc07a3d65885e11786 Mon Sep 17 00:00:00 2001 From: Andrew Peabody Date: Tue, 19 Jul 2022 12:51:44 -0700 Subject: [PATCH] feat: add var and output for ACM version (#1322) --- modules/acm/README.md | 2 ++ modules/acm/feature.tf | 2 +- modules/acm/outputs.tf | 5 +++++ modules/acm/variables.tf | 6 ++++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/acm/README.md b/modules/acm/README.md index 88249e532b..590848552f 100644 --- a/modules/acm/README.md +++ b/modules/acm/README.md @@ -66,6 +66,7 @@ data "google_client_config" "default" {} |------|-------------|------|---------|:--------:| | cluster\_membership\_id | The cluster membership ID. If unset, one will be autogenerated. | `string` | `""` | no | | cluster\_name | GCP cluster Name used to reach cluster and which becomes the cluster name in the Config Sync kubernetes custom resource. | `string` | n/a | yes | +| configmanagement\_version | Version of ACM. | `string` | `""` | no | | create\_ssh\_key | Controls whether a key will be generated for Git authentication | `bool` | `true` | no | | enable\_fleet\_feature | Whether to enable the ACM feature on the fleet. | `bool` | `true` | no | | enable\_fleet\_registration | Whether to create a new membership. | `bool` | `true` | no | @@ -87,6 +88,7 @@ data "google_client_config" "default" {} | Name | Description | |------|-------------| +| configmanagement\_version | Version of ACM installed. | | git\_creds\_public | Public key of SSH keypair to allow the Anthos Config Management Operator to authenticate to your Git repository. | | wait | An output to use when you want to depend on cmd finishing | diff --git a/modules/acm/feature.tf b/modules/acm/feature.tf index e80df8368d..3b523ffb6c 100644 --- a/modules/acm/feature.tf +++ b/modules/acm/feature.tf @@ -36,7 +36,7 @@ resource "google_gke_hub_feature_membership" "main" { project = var.project_id configmanagement { - version = "1.11.0" + version = var.configmanagement_version config_sync { source_format = var.source_format != "" ? var.source_format : null diff --git a/modules/acm/outputs.tf b/modules/acm/outputs.tf index 316bea10cd..063d5f171f 100644 --- a/modules/acm/outputs.tf +++ b/modules/acm/outputs.tf @@ -19,6 +19,11 @@ output "git_creds_public" { value = var.create_ssh_key ? coalesce(tls_private_key.k8sop_creds.*.public_key_openssh...) : null } +output "configmanagement_version" { + description = "Version of ACM installed." + value = google_gke_hub_feature_membership.main.configmanagement[0].version +} + output "wait" { description = "An output to use when you want to depend on cmd finishing" value = google_gke_hub_feature_membership.main.membership diff --git a/modules/acm/variables.tf b/modules/acm/variables.tf index 040e1468a3..6c576bb640 100644 --- a/modules/acm/variables.tf +++ b/modules/acm/variables.tf @@ -47,6 +47,12 @@ variable "cluster_membership_id" { default = "" } +variable "configmanagement_version" { + description = "Version of ACM." + type = string + default = "" +} + # Config Sync variables variable "sync_repo" { description = "ACM Git repo address"