Skip to content

Commit

Permalink
Use tolist instead of deprecated list
Browse files Browse the repository at this point in the history
  • Loading branch information
klejejs committed Sep 27, 2024
1 parent 5325365 commit b55648b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .modules/service/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ resource "aws_ecs_task_definition" "task" {
family = var.service_name
cpu = var.ecs_cpu
memory = var.ecs_memory
execution_role_arn = element(concat(aws_iam_role.ecs-execution.*.arn, list(var.ecs_execution_role_arn)), var.ecs_execution_role_arn == "" ? 0 : 1)
task_role_arn = element(concat(aws_iam_role.task-execution.*.arn, list(var.ecs_task_execution_role_arn)), var.ecs_task_execution_role_arn == "" ? 0 : 1)
execution_role_arn = element(concat(aws_iam_role.ecs-execution.*.arn, tolist([var.ecs_execution_role_arn])), var.ecs_execution_role_arn == "" ? 0 : 1)
task_role_arn = element(concat(aws_iam_role.task-execution.*.arn, tolist([var.ecs_task_execution_role_arn])), var.ecs_task_execution_role_arn == "" ? 0 : 1)
network_mode = "awsvpc"
requires_compatibilities = [var.launch_type]

Expand Down
4 changes: 2 additions & 2 deletions .modules/service/policy.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource "aws_iam_role" "ecs-execution" {
resource "aws_iam_role_policy_attachment" "ecs-execution-managed" {
count = var.ecs_execution_role_arn == "" ? 1 : 0

role = element(concat(aws_iam_role.ecs-execution.*.id, list("")), var.ecs_execution_role_arn == "" ? 0 : 1)
role = element(concat(aws_iam_role.ecs-execution.*.id, tolist([""])), var.ecs_execution_role_arn == "" ? 0 : 1)
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy"
}

Expand Down Expand Up @@ -60,5 +60,5 @@ resource "aws_iam_role_policy" "task-role" {
count = var.ecs_task_execution_role_arn == "" ? 1 : 0

policy = data.aws_iam_policy_document.task-policy.json
role = element(concat(aws_iam_role.task-execution.*.id, list("")), var.ecs_task_execution_role_arn == "" ? 0 : 1)
role = element(concat(aws_iam_role.task-execution.*.id, tolist([""])), var.ecs_task_execution_role_arn == "" ? 0 : 1)
}

0 comments on commit b55648b

Please sign in to comment.