feat: Add support for creating efa-only network interfaces (#3196)

This commit is contained in:
Bryant Biggs
2024-11-02 13:33:13 +00:00
committed by GitHub
parent ac14562541
commit c6da22c78f
10 changed files with 195 additions and 78 deletions

View File

@@ -44,13 +44,14 @@ locals {
efa_instance_type = try(element(var.instance_types, 0), "")
num_network_cards = try(data.aws_ec2_instance_type.this[0].maximum_network_cards, 0)
# Primary network interface must be EFA, remaining can be EFA or EFA-only
efa_network_interfaces = [
for i in range(local.num_network_cards) : {
associate_public_ip_address = false
delete_on_termination = true
device_index = i == 0 ? 0 : 1
network_card_index = i
interface_type = "efa"
interface_type = var.enable_efa_only ? contains(concat([0], var.efa_indices), i) ? "efa" : "efa-only" : "efa"
}
]