Skip to content

Commit

Permalink
feat: add var and output for ACM version (terraform-google-modules#1322)
Browse files Browse the repository at this point in the history
  • Loading branch information
apeabody authored Jul 19, 2022
1 parent 4d526f9 commit 35b2bf5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions modules/acm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |

Expand Down
2 changes: 1 addition & 1 deletion modules/acm/feature.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions modules/acm/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions modules/acm/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 35b2bf5

Please sign in to comment.