File tree Expand file tree Collapse file tree 3 files changed +21
-16
lines changed Expand file tree Collapse file tree 3 files changed +21
-16
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -12,12 +12,20 @@ locals {
12
12
port = 5432
13
13
}
14
14
15
+
16
+
15
17
ecs = {
16
18
user_data = << EOF
17
19
#!/bin/bash
18
20
echo ECS_CLUSTER=${ var . cluster_name } >> /etc/ecs/ecs.config;
19
21
EOF
20
22
ecs_node_sg_name = " kong"
23
+ iam = {
24
+ name_prefix = " kong-ecs-exec"
25
+ ecs_exec_policy_arn = [" arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy" ]
26
+ principal_type = " Service"
27
+ principal_identifiers = [" ecs-tasks.amazonaws.com" ]
28
+ }
21
29
}
22
30
23
31
kong = {
Original file line number Diff line number Diff line change @@ -177,6 +177,18 @@ module "ecs_task_security_group" {
177
177
tags = local. default_tags
178
178
}
179
179
180
+ # ###############################################################################
181
+ # ECS Execution IAM Role
182
+ # ###############################################################################
183
+
184
+ module "ecs_exec_role" {
185
+ source = " ./modules/iam"
186
+ name_prefix = local. ecs . iam . name_prefix
187
+ principal_type = local. ecs . iam . principal_type
188
+ principal_identifiers = local. ecs . iam . principal_identifiers
189
+ policy_arns = local. ecs . iam . ecs_exec_policy_arn
190
+ }
191
+
180
192
# ###############################################################################
181
193
# ECS Kong
182
194
# ###############################################################################
@@ -213,7 +225,7 @@ module "ecs_kong" {
213
225
network_mode = local.kong.network_mode
214
226
cpu = var.cpu_for_kong_task
215
227
memory = var.memory_for_kong_task
216
- task_role_arn = module.ecs_task_role .role_arn
228
+ task_role_arn = module.ecs_exec_role .role_arn
217
229
execution_role_arn = module.ecs_exec_role.role_arn
218
230
219
231
container_definitions = [
You can’t perform that action at this time.
0 commit comments