Created
April 9, 2015 22:52
-
-
Save bensojona/8930f77a2ae80815fe63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_instance" "consul" { | |
ami = "${var.ami}" | |
security_groups = ["${var.security_group}"] | |
key_name = "${var.key_name}" | |
instance_type = "${var.instance_type}" | |
availability_zone = "${var.availability_zone}" | |
count = "${var.count}" | |
tags { | |
Name = "consul_${count.index+1}" | |
} | |
provisioner "remote-exec" { | |
inline = [ | |
"sudo sed -i -- 's/{{ atlas_username }}/${var.atlas_username}/g' /etc/init/consul.conf", | |
"sudo sed -i -- 's/{{ atlas_environment }}/${var.atlas_environment}/g' /etc/init/consul.conf", | |
"sudo sed -i -- 's/{{ atlas_token }}/${var.atlas_token}/g' /etc/init/consul.conf", | |
"sudo service consul restart" | |
] | |
connection { | |
user = "${var.user}" | |
key_file = "${var.key_file}" | |
agent = "${var.agent}" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment