Skip to content

Commit

Permalink
feat: added resource
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolnagpal committed Jun 7, 2023
1 parent c49f202 commit 7dd81c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions _example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ provider "aws" {
module "keypair" {
source = "./../"

name = "key"
environment = "test"
label_order = ["environment", "name"]
name = "key"
environment = "test"
label_order = ["environment", "name"]

public_key = ""
create_private_key_enabled = true
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "aws_key_pair" "default" {
count = var.enable_key_pair ? 1 : 0

key_name = format("%s-pair", module.labels.id)
public_key = var.enable_key_pair == true ? trimspace(tls_private_key.default[0].public_key_openssh) : var.public_key
public_key = var.public_key == "" ? trimspace(tls_private_key.default[0].public_key_openssh) : var.public_key

tags = module.labels.tags
}
Expand Down

0 comments on commit 7dd81c4

Please sign in to comment.