Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ validate-ami:
pack-ami validate -p ./packer -t ${template}

build-ami:
pack-ami build -p ./packer -t ${template} | tee /tmp/build-ami.output
@cat /tmp/build-ami.output | tfvar-ami ${template} > ${template)_ami.tfvars
@rm -f /tmp/build-ami.output
pack-ami build -p ./packer -t ${template}

test:
@bash scripts/test.sh
Expand Down
3 changes: 0 additions & 3 deletions base_ami.tf

This file was deleted.

3 changes: 0 additions & 3 deletions ecs_ami.tf

This file was deleted.

24 changes: 23 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,28 @@ variable "ecs_security_groups" {
default = ""
}

variable "ecs_ami" {
description = "The AMI that will be used to launch EC2 instances in the ECS cluster"
default = ""
}

variable "default_ecs_ami" {
description = "A mapping of AWS regions to the default ECS AMIs"

default = {
us-east-1 = "ami-5f3ff932"
us-west-1 = "ami-31c08551"
us-west-2 = "ami-f3985d93"
eu-west-1 = "ami-ab4bd5d8"
eu-central-1 = "ami-6c58b103"
ap-northeast-1 = "ami-a69d68c7"
ap-northeast-2 = "ami-7b2de615"
ap-southeast-1 = "ami-550dde36"
ap-southeast-2 = "ami-c799b0a4"
sa-east-1 = "ami-0274fe6e"
}
}

module "vpc" {
source = "./vpc"
name = "${var.name}"
Expand Down Expand Up @@ -164,7 +186,7 @@ module "ecs_cluster" {
name = "default"
environment = "${var.environment}"
vpc_id = "${module.vpc.id}"
image_id = "${var.ecs_ami}"
image_id = "${coalesce(var.ecs_ami, lookup(var.default_ecs_ami, var.region))}"
subnet_ids = "${module.vpc.internal_subnets}"
key_name = "${var.key_name}"
instance_type = "${var.ecs_instance_type}"
Expand Down
1 change: 0 additions & 1 deletion task/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*
*/


/**
* Required Variables.
*/
Expand Down
1 change: 0 additions & 1 deletion worker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*
*/


/**
* Required Variables.
*/
Expand Down