File tree 6 files changed +24
-12
lines changed 6 files changed +24
-12
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,7 @@ validate-ami:
46
46
pack-ami validate -p ./packer -t ${template}
47
47
48
48
build-ami :
49
- pack-ami build -p ./packer -t ${template} | tee /tmp/build-ami.output
50
- @cat /tmp/build-ami.output | tfvar-ami ${template} > ${template)_ami.tfvars
51
- @rm -f /tmp/build-ami.output
49
+ pack-ami build -p ./packer -t ${template}
52
50
53
51
test :
54
52
@bash scripts/test.sh
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -109,6 +109,28 @@ variable "ecs_security_groups" {
109
109
default = " "
110
110
}
111
111
112
+ variable "ecs_ami" {
113
+ description = " The AMI that will be used to launch EC2 instances in the ECS cluster"
114
+ default = " "
115
+ }
116
+
117
+ variable "default_ecs_ami" {
118
+ description = " A mapping of AWS regions to the default ECS AMIs"
119
+
120
+ default = {
121
+ us-east-1 = " ami-5f3ff932"
122
+ us-west-1 = " ami-31c08551"
123
+ us-west-2 = " ami-f3985d93"
124
+ eu-west-1 = " ami-ab4bd5d8"
125
+ eu-central-1 = " ami-6c58b103"
126
+ ap-northeast-1 = " ami-a69d68c7"
127
+ ap-northeast-2 = " ami-7b2de615"
128
+ ap-southeast-1 = " ami-550dde36"
129
+ ap-southeast-2 = " ami-c799b0a4"
130
+ sa-east-1 = " ami-0274fe6e"
131
+ }
132
+ }
133
+
112
134
module "vpc" {
113
135
source = " ./vpc"
114
136
name = " ${ var . name } "
@@ -164,7 +186,7 @@ module "ecs_cluster" {
164
186
name = " default"
165
187
environment = " ${ var . environment } "
166
188
vpc_id = " ${ module . vpc . id } "
167
- image_id = " ${ var . ecs_ami } "
189
+ image_id = " ${ coalesce ( var. ecs_ami , lookup (var . default_ecs_ami , var . region )) } "
168
190
subnet_ids = " ${ module . vpc . internal_subnets } "
169
191
key_name = " ${ var . key_name } "
170
192
instance_type = " ${ var . ecs_instance_type } "
Original file line number Diff line number Diff line change 11
11
*
12
12
*/
13
13
14
-
15
14
/* *
16
15
* Required Variables.
17
16
*/
Original file line number Diff line number Diff line change 13
13
*
14
14
*/
15
15
16
-
17
16
/* *
18
17
* Required Variables.
19
18
*/
You can’t perform that action at this time.
0 commit comments