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

Add variable to allow a pre-generated SSH key to be passed to the ACM module #346

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
1 change: 1 addition & 0 deletions modules/acm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ By default, this module will attempt to download the ACM operator from Google di
| operator\_path | Path to the operator yaml config. If unset, will download from GCS releases. | string | `"null"` | no |
| policy\_dir | Subfolder containing configs in ACM Git repo | string | n/a | yes |
| project\_id | The project in which the resource belongs. | string | n/a | yes |
| ssh\_auth\_key | Key for Git authentication. Overrides 'create_ssh_key' variable. Can be set using 'file(path/to/file)'-function. | string | `"null"` | no |
| sync\_branch | ACM repo Git branch | string | `"master"` | no |
| sync\_repo | ACM Git repo address | string | n/a | yes |

Expand Down
2 changes: 1 addition & 1 deletion modules/acm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ locals {
cluster_endpoint = "https://${var.cluster_endpoint}"
token = data.google_client_config.default.access_token
cluster_ca_certificate = data.google_container_cluster.primary.master_auth.0.cluster_ca_certificate
private_key = var.create_ssh_key ? tls_private_key.git_creds[0].private_key_pem : ""
private_key = var.create_ssh_key && var.ssh_auth_key == null ? tls_private_key.git_creds[0].private_key_pem : var.ssh_auth_key
download_operator = var.operator_path == null ? true : false
operator_path = local.download_operator ? "${path.module}/config-management-operator.yaml" : var.operator_path
}
Expand Down
6 changes: 6 additions & 0 deletions modules/acm/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ variable "create_ssh_key" {
default = true
}

variable "ssh_auth_key" {
description = "Key for Git authentication. Overrides 'create_ssh_key' variable. Can be set using 'file(path/to/file)'-function."
type = string
default = null
}

variable "enable_policy_controller" {
description = "Whether to enable the ACM Policy Controller on the cluster"
type = bool
Expand Down