Remove module.ssh-key. Moving tls_private_key inside the module to root directory, output tls keys.#189
Conversation
module.ssh-key to module.ssh_key to meet the community naming convention.module.ssh-key to module.ssh_key to meet the community naming convention.
module.ssh-key to module.ssh_key to meet the community naming convention.module.ssh-key. Moving tls_private_key inside the module to root directory, output tls keys.
|
I understand the goal of this PR is to be automation friendly and avoid a ssh-key saved as a local file. Here my considerations:
This block of code with the linux profile is optional: I suggest, to be automation friendly, to provide an option to disable the generation of the ssh key and put the Note that when creating a AKS cluster using the Azure Portal there is no way to specify the Linux profile and provide a key. @lonegunmanb what do you think about adding to this PR the ability to disable the ssh-key completely ? |
|
Hi @zioproto, thanks for your review. My thought is we just leave the Now the As all arguments in |
zioproto
left a comment
There was a problem hiding this comment.
LGTM. You could add a count to the tls_private_key resource for completeness
| to = tls_private_key.ssh | ||
| } | ||
|
|
||
| resource "tls_private_key" "ssh" { |
There was a problem hiding this comment.
Why not adding here this ?
count = var.admin_username == null ? 0 : 1
There was a problem hiding this comment.
Yeah that works, but it will also require using index when we reference the resource, and I think an unused private key resource won't do harm, so I choose a shortcut.
…o root directory, output tls keys.
…. All existing cluster need to assign `admin_username`(which default value is `azureuser`) explicitly OR THE CLUSTER WILL BE REPLACED!
This patch removes
module.ssh-keyand movestls_private_keyinside the module to root directory, then outputs tls keys to fix #184 and #191 issues. Since themovedblock was introduced since Terraform v1.1, this patch bumped the version to v1.1 too.