-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add variable to allow a pre-generated SSH key to be passed to the ACM module #346
Conversation
paulpalamarchuk
commented
Nov 22, 2019
- Fix Add var to allow a pre-generated SSH key to be passed to the ACM module #329
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @paulpalamarchuk! A couple of changes requested.
modules/acm/variables.tf
Outdated
variable "ssh_auth_key" { | ||
description = "Key for Git authentication. Overrides 'create_ssh_key' variable." | ||
type = string | ||
default = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use null
for empty defaults when possible.
default = "" | |
default = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set to ""
because it's used in "local-exec" command
modules/acm/main.tf
Outdated
@@ -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 == "" ? tls_private_key.git_creds[0].private_key_pem : var.ssh_auth_key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private_key = var.create_ssh_key && var.ssh_auth_key == "" ? tls_private_key.git_creds[0].private_key_pem : var.ssh_auth_key | |
private_key = var.create_ssh_key && var.ssh_auth_key == null ? tls_private_key.git_creds[0].private_key_pem : var.ssh_auth_key |
efece2f
to
11797c4
Compare
…add_var_to_pass_ssh-key_in_acm Add variable to allow a pre-generated SSH key to be passed to the ACM module