Skip to content

Commit

Permalink
move locals into a separete file
Browse files Browse the repository at this point in the history
  • Loading branch information
BARRY Thierno Ibrahima (Canal Plus Prestataire) committed Nov 4, 2020
1 parent a8625de commit 2890606
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion modules/fargate/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ data "aws_iam_role" "custom_fargate_iam_role" {
count = local.create_eks && ! var.create_fargate_pod_execution_role ? 1 : 0
name = var.fargate_pod_execution_role_name
}

6 changes: 0 additions & 6 deletions modules/fargate/fargate.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
locals {
create_eks = var.create_eks && length(var.fargate_profiles) > 0
pod_execution_role_arn = var.create_fargate_pod_execution_role ? element(concat(aws_iam_role.eks_fargate_pod.*.arn, list("")), 0) : element(concat(data.aws_iam_role.custom_fargate_iam_role.*.arn, list("")), 0)
pod_execution_role_name = var.create_fargate_pod_execution_role ? element(concat(aws_iam_role.eks_fargate_pod.*.name, list("")), 0) : element(concat(data.aws_iam_role.custom_fargate_iam_role.*.name, list("")), 0)
}

resource "aws_iam_role" "eks_fargate_pod" {
count = local.create_eks && var.create_fargate_pod_execution_role ? 1 : 0
name_prefix = format("%s-fargate", var.cluster_name)
Expand Down
5 changes: 5 additions & 0 deletions modules/fargate/locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
locals {
create_eks = var.create_eks && length(var.fargate_profiles) > 0
pod_execution_role_arn = var.create_fargate_pod_execution_role ? element(concat(aws_iam_role.eks_fargate_pod.*.arn, list("")), 0) : element(concat(data.aws_iam_role.custom_fargate_iam_role.*.arn, list("")), 0)
pod_execution_role_name = var.create_fargate_pod_execution_role ? element(concat(aws_iam_role.eks_fargate_pod.*.name, list("")), 0) : element(concat(data.aws_iam_role.custom_fargate_iam_role.*.name, list("")), 0)
}

0 comments on commit 2890606

Please sign in to comment.