1
0
mirror of https://github.com/terraform-aws-modules/terraform-aws-eks.git synced 2025-09-09 19:32:58 +08:00

fix: Remediate type mismatch for EFA interfaces and ensure correct (local) definition is used (#3491)

This commit is contained in:
Bryant Biggs
2025-08-24 12:59:13 -05:00
committed by GitHub
parent f56e87eecd
commit 3959b65672
8 changed files with 92 additions and 36 deletions
+38 -6
View File
@@ -82,7 +82,7 @@ module "user_data" {
################################################################################
data "aws_ec2_instance_type" "this" {
count = var.create && var.enable_efa_support ? 1 : 0
count = local.enable_efa_support ? 1 : 0
region = var.region
@@ -103,6 +103,24 @@ locals {
device_index = i == 0 ? 0 : 1
network_card_index = i
interface_type = var.enable_efa_only ? contains(concat([0], var.efa_indices), i) ? "efa" : "efa-only" : "efa"
# Null out due to error: The true and false result expressions must have consistent types. The 'true' value is tuple, but the 'false' value is list of objects.
associate_carrier_ip_address = null
connection_tracking_specification = null
description = "EFA${var.enable_efa_only ? "-only" : ""} Network Interface ${i}"
ena_srd_specification = null
ipv4_address_count = null
ipv4_addresses = null
ipv4_prefix_count = null
ipv4_prefixes = null
ipv6_address_count = null
ipv6_addresses = null
ipv6_prefix_count = null
ipv6_prefixes = null
network_interface_id = null
primary_ipv6 = null
private_ip_address = null
security_groups = []
}
]
@@ -365,7 +383,7 @@ resource "aws_launch_template" "this" {
name_prefix = var.launch_template_use_name_prefix ? "${local.launch_template_name}-" : null
dynamic "network_interfaces" {
for_each = length(var.network_interfaces) > 0 ? var.network_interfaces : []
for_each = length(local.network_interfaces) > 0 ? local.network_interfaces : []
content {
associate_carrier_ip_address = network_interfaces.value.associate_carrier_ip_address
@@ -976,9 +994,16 @@ locals {
{
all_self_efa = {
description = "Node to node EFA"
protocol = "-1"
from_port = 0
ip_protocol = "-1"
self = true
# Null out due to variable type and not using `try()` in resource
cidr_ipv4 = null
cidr_ipv6 = null
from_port = null
name = null
prefix_list_id = null
tags = {}
}
} : k => v if var.enable_efa_support
},
@@ -988,9 +1013,16 @@ locals {
{
all_self_efa = {
description = "Node to node EFA"
protocol = "-1"
to_port = 0
ip_protocol = "-1"
self = true
# Null out due to variable type and not using `try()` in resource
cidr_ipv4 = null
cidr_ipv6 = null
to_port = null
name = null
prefix_list_id = null
tags = {}
}
} : k => v if var.enable_efa_support
},