Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add var and output for ACM version #1322

Merged
merged 4 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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