We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a202c67 commit 6c6921bCopy full SHA for 6c6921b
main.tf
@@ -35,14 +35,14 @@ resource "aws_key_pair" "generated" {
35
}
36
37
resource "local_file" "public_key_openssh" {
38
- count = local.enabled && var.generate_ssh_key == true ? 1 : 0
+ count = local.enabled && var.generate_ssh_key == true && var.save_ssh_key ? 1 : 0
39
depends_on = [tls_private_key.default]
40
content = tls_private_key.default[0].public_key_openssh
41
filename = local.public_key_filename
42
43
44
resource "local_sensitive_file" "private_key_pem" {
45
46
47
content = tls_private_key.default[0].private_key_pem
48
filename = local.private_key_filename
0 commit comments