Skip to content

Commit

Permalink
Fix overwriting key pair
Browse files Browse the repository at this point in the history
  • Loading branch information
npalm committed Jul 21, 2019
1 parent f82a9ad commit 062957a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aws_key_pair" "key" {
count = var.ssh_key_pair == "" ? 0 : 1
count = var.ssh_key_pair == "" ? 1 : 0
key_name = "${var.environment}-gitlab-runner"
public_key = var.ssh_public_key
}
Expand Down Expand Up @@ -344,7 +344,7 @@ resource "aws_iam_role_policy_attachment" "docker_machine_cache_instance" {
### docker machine instance policy
################################################################################
data "template_file" "dockermachine_role_trust_policy" {
template = file("${path.module}/policies/instance-role-trust-policy.json")
template = length(var.docker_machine_role_json) > 0 ? var.docker_machine_role_json : file("${path.module}/policies/instance-role-trust-policy.json")
}
resource "aws_iam_role" "docker_machine" {
Expand Down

0 comments on commit 062957a

Please sign in to comment.