Skip to content

Commit 35b2bf5

Browse files
authored
feat: add var and output for ACM version (#1322)
1 parent 4d526f9 commit 35b2bf5

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

modules/acm/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ data "google_client_config" "default" {}
6666
|------|-------------|------|---------|:--------:|
6767
| cluster\_membership\_id | The cluster membership ID. If unset, one will be autogenerated. | `string` | `""` | no |
6868
| 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 |
69+
| configmanagement\_version | Version of ACM. | `string` | `""` | no |
6970
| create\_ssh\_key | Controls whether a key will be generated for Git authentication | `bool` | `true` | no |
7071
| enable\_fleet\_feature | Whether to enable the ACM feature on the fleet. | `bool` | `true` | no |
7172
| enable\_fleet\_registration | Whether to create a new membership. | `bool` | `true` | no |
@@ -87,6 +88,7 @@ data "google_client_config" "default" {}
8788

8889
| Name | Description |
8990
|------|-------------|
91+
| configmanagement\_version | Version of ACM installed. |
9092
| git\_creds\_public | Public key of SSH keypair to allow the Anthos Config Management Operator to authenticate to your Git repository. |
9193
| wait | An output to use when you want to depend on cmd finishing |
9294

modules/acm/feature.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ resource "google_gke_hub_feature_membership" "main" {
3636
project = var.project_id
3737

3838
configmanagement {
39-
version = "1.11.0"
39+
version = var.configmanagement_version
4040

4141
config_sync {
4242
source_format = var.source_format != "" ? var.source_format : null

modules/acm/outputs.tf

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ output "git_creds_public" {
1919
value = var.create_ssh_key ? coalesce(tls_private_key.k8sop_creds.*.public_key_openssh...) : null
2020
}
2121

22+
output "configmanagement_version" {
23+
description = "Version of ACM installed."
24+
value = google_gke_hub_feature_membership.main.configmanagement[0].version
25+
}
26+
2227
output "wait" {
2328
description = "An output to use when you want to depend on cmd finishing"
2429
value = google_gke_hub_feature_membership.main.membership

modules/acm/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ variable "cluster_membership_id" {
4747
default = ""
4848
}
4949

50+
variable "configmanagement_version" {
51+
description = "Version of ACM."
52+
type = string
53+
default = ""
54+
}
55+
5056
# Config Sync variables
5157
variable "sync_repo" {
5258
description = "ACM Git repo address"

0 commit comments

Comments
 (0)