Skip to content

Commit

Permalink
Add variable to allow a pre-generated SSH key to be passed to the ACM…
Browse files Browse the repository at this point in the history
… module

 * Fix hashicorp#329
  • Loading branch information
paulpalamarchuk committed Dec 2, 2019
1 parent 4ea7584 commit 11797c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
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

0 comments on commit 11797c4

Please sign in to comment.