chore: Fix terraform format for TF 0.14 (#1157)

This commit is contained in:
Thierno IB. BARRY
2020-12-22 11:32:13 +01:00
committed by GitHub
parent 942a88e18f
commit ea2f6982d5
4 changed files with 11 additions and 11 deletions

View File

@@ -27,7 +27,7 @@ resource "aws_eks_cluster" "this" {
delete = var.cluster_delete_timeout delete = var.cluster_delete_timeout
} }
dynamic encryption_config { dynamic "encryption_config" {
for_each = toset(var.cluster_encryption_config) for_each = toset(var.cluster_encryption_config)
content { content {

View File

@@ -12,6 +12,6 @@ data "aws_iam_policy_document" "eks_fargate_pod_assume_role" {
} }
data "aws_iam_role" "custom_fargate_iam_role" { data "aws_iam_role" "custom_fargate_iam_role" {
count = local.create_eks && ! var.create_fargate_pod_execution_role ? 1 : 0 count = local.create_eks && !var.create_fargate_pod_execution_role ? 1 : 0
name = var.fargate_pod_execution_role_name name = var.fargate_pod_execution_role_name
} }

View File

@@ -133,7 +133,7 @@ resource "aws_autoscaling_group" "workers" {
"value", tag_value, "value", tag_value,
"propagate_at_launch", "true" "propagate_at_launch", "true"
) )
if tag_key != "Name" && ! contains([for tag in lookup(var.worker_groups[count.index], "tags", local.workers_group_defaults["tags"]) : tag["key"]], tag_key) if tag_key != "Name" && !contains([for tag in lookup(var.worker_groups[count.index], "tags", local.workers_group_defaults["tags"]) : tag["key"]], tag_key)
], ],
lookup( lookup(
var.worker_groups[count.index], var.worker_groups[count.index],
@@ -194,7 +194,7 @@ resource "aws_launch_configuration" "workers" {
ebs_optimized = lookup( ebs_optimized = lookup(
var.worker_groups[count.index], var.worker_groups[count.index],
"ebs_optimized", "ebs_optimized",
! contains( !contains(
local.ebs_optimized_not_supported, local.ebs_optimized_not_supported,
lookup( lookup(
var.worker_groups[count.index], var.worker_groups[count.index],

View File

@@ -93,7 +93,7 @@ resource "aws_autoscaling_group" "workers_launch_template" {
local.workers_group_defaults["health_check_grace_period"] local.workers_group_defaults["health_check_grace_period"]
) )
dynamic mixed_instances_policy { dynamic "mixed_instances_policy" {
iterator = item iterator = item
for_each = (lookup(var.worker_groups_launch_template[count.index], "override_instance_types", null) != null) || (lookup(var.worker_groups_launch_template[count.index], "on_demand_allocation_strategy", local.workers_group_defaults["on_demand_allocation_strategy"]) != null) ? list(var.worker_groups_launch_template[count.index]) : [] for_each = (lookup(var.worker_groups_launch_template[count.index], "override_instance_types", null) != null) || (lookup(var.worker_groups_launch_template[count.index], "on_demand_allocation_strategy", local.workers_group_defaults["on_demand_allocation_strategy"]) != null) ? list(var.worker_groups_launch_template[count.index]) : []
@@ -157,7 +157,7 @@ resource "aws_autoscaling_group" "workers_launch_template" {
} }
} }
dynamic launch_template { dynamic "launch_template" {
iterator = item iterator = item
for_each = (lookup(var.worker_groups_launch_template[count.index], "override_instance_types", null) != null) || (lookup(var.worker_groups_launch_template[count.index], "on_demand_allocation_strategy", local.workers_group_defaults["on_demand_allocation_strategy"]) != null) ? [] : list(var.worker_groups_launch_template[count.index]) for_each = (lookup(var.worker_groups_launch_template[count.index], "override_instance_types", null) != null) || (lookup(var.worker_groups_launch_template[count.index], "on_demand_allocation_strategy", local.workers_group_defaults["on_demand_allocation_strategy"]) != null) ? [] : list(var.worker_groups_launch_template[count.index])
@@ -209,7 +209,7 @@ resource "aws_autoscaling_group" "workers_launch_template" {
"value", tag_value, "value", tag_value,
"propagate_at_launch", "true" "propagate_at_launch", "true"
) )
if tag_key != "Name" && ! contains([for tag in lookup(var.worker_groups_launch_template[count.index], "tags", local.workers_group_defaults["tags"]) : tag["key"]], tag_key) if tag_key != "Name" && !contains([for tag in lookup(var.worker_groups_launch_template[count.index], "tags", local.workers_group_defaults["tags"]) : tag["key"]], tag_key)
], ],
lookup( lookup(
var.worker_groups_launch_template[count.index], var.worker_groups_launch_template[count.index],
@@ -289,7 +289,7 @@ resource "aws_launch_template" "workers_launch_template" {
ebs_optimized = lookup( ebs_optimized = lookup(
var.worker_groups_launch_template[count.index], var.worker_groups_launch_template[count.index],
"ebs_optimized", "ebs_optimized",
! contains( !contains(
local.ebs_optimized_not_supported, local.ebs_optimized_not_supported,
lookup( lookup(
var.worker_groups_launch_template[count.index], var.worker_groups_launch_template[count.index],
@@ -336,7 +336,7 @@ resource "aws_launch_template" "workers_launch_template" {
) )
} }
dynamic placement { dynamic "placement" {
for_each = lookup(var.worker_groups_launch_template[count.index], "launch_template_placement_group", local.workers_group_defaults["launch_template_placement_group"]) != null ? [lookup(var.worker_groups_launch_template[count.index], "launch_template_placement_group", local.workers_group_defaults["launch_template_placement_group"])] : [] for_each = lookup(var.worker_groups_launch_template[count.index], "launch_template_placement_group", local.workers_group_defaults["launch_template_placement_group"]) != null ? [lookup(var.worker_groups_launch_template[count.index], "launch_template_placement_group", local.workers_group_defaults["launch_template_placement_group"])] : []
content { content {
@@ -349,7 +349,7 @@ resource "aws_launch_template" "workers_launch_template" {
} }
} }
dynamic instance_market_options { dynamic "instance_market_options" {
for_each = lookup(var.worker_groups_launch_template[count.index], "market_type", null) == null ? [] : list(lookup(var.worker_groups_launch_template[count.index], "market_type", null)) for_each = lookup(var.worker_groups_launch_template[count.index], "market_type", null) == null ? [] : list(lookup(var.worker_groups_launch_template[count.index], "market_type", null))
content { content {
market_type = instance_market_options.value market_type = instance_market_options.value
@@ -458,7 +458,7 @@ resource "aws_launch_template" "workers_launch_template" {
}, },
{ for tag_key, tag_value in var.tags : { for tag_key, tag_value in var.tags :
tag_key => tag_value tag_key => tag_value
if tag_key != "Name" && ! contains([for tag in lookup(var.worker_groups_launch_template[count.index], "tags", local.workers_group_defaults["tags"]) : tag["key"]], tag_key) if tag_key != "Name" && !contains([for tag in lookup(var.worker_groups_launch_template[count.index], "tags", local.workers_group_defaults["tags"]) : tag["key"]], tag_key)
} }
) )
} }