diff --git a/terraform/aws/consul.tf b/terraform/aws/consul.tf index 2bb8ca34b..9a2c5fcf7 100644 --- a/terraform/aws/consul.tf +++ b/terraform/aws/consul.tf @@ -1,10 +1,3 @@ -# Specify the provider and access details -provider "aws" { - region = "${var.region}" - access_key = "${var.access_key}" - secret_key = "${var.secret_key}" -} - resource "aws_instance" "server" { ami = "${lookup(var.ami, var.region)}" instance_type = "${var.instance_type}" @@ -17,6 +10,11 @@ resource "aws_instance" "server" { key_file = "${var.key_path}" } + #Instance tags + tags { + Name = "${var.tagName}-${count.index}" + } + provisioner "file" { source = "${path.module}/scripts/upstart.conf" destination = "/tmp/upstart.conf" @@ -41,11 +39,6 @@ resource "aws_instance" "server" { "${path.module}/scripts/service.sh", ] } - - #Instance tags - tags { - Name = "${var.tagName}-${count.index}" - } } resource "aws_security_group" "consul" { @@ -74,4 +67,12 @@ resource "aws_security_group" "consul" { protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] } + + // This is for outbound internet access + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } } diff --git a/terraform/aws/variables.tf b/terraform/aws/variables.tf index eb5f390ab..2d92711f6 100644 --- a/terraform/aws/variables.tf +++ b/terraform/aws/variables.tf @@ -1,11 +1,3 @@ -variable "access_key" { - description = "AWS Access Key." -} - -variable "secret_key" { - description = "AWS Secret Key" -} - variable "ami" { default = { us-east-1 = "ami-3acc7a52" @@ -35,8 +27,7 @@ variable "instance_type" { default = "m1.small" description = "The instance type to launch." } - variable "tagName" { default = "consul" description = "Name tag for the servers" -} +} \ No newline at end of file