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

Conversation

paulpalamarchuk
Copy link
Contributor

nick4fake
nick4fake previously approved these changes Nov 25, 2019
@paulpalamarchuk paulpalamarchuk marked this pull request as ready for review November 25, 2019 16:54
@aaron-lane aaron-lane added the enhancement New feature or request label Nov 26, 2019
Copy link
Contributor

@aaron-lane aaron-lane left a 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.

variable "ssh_auth_key" {
description = "Key for Git authentication. Overrides 'create_ssh_key' variable."
type = string
default = ""
Copy link
Contributor

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.

Suggested change
default = ""
default = null

Copy link
Contributor Author

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

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

@morgante morgante merged commit 19015da into terraform-google-modules:master Dec 2, 2019
CPL-markus pushed a commit to WALTER-GROUP/terraform-google-kubernetes-engine that referenced this pull request Jul 15, 2024
…add_var_to_pass_ssh-key_in_acm

Add variable to allow a pre-generated SSH key to be passed to the ACM module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add var to allow a pre-generated SSH key to be passed to the ACM module
4 participants