Terraform CLI and Terraform AWS Provider Version
Terraform v1.1.7
Terraform AWS Provider v4.10.0
Affected Resource(s)
- aws_network_interface
- aws_instance
Terraform Configuration Files
provider "aws" {
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"
region = "${var.region}"
}
resource "aws_network_interface" "ec2_ani" {
subnet_id = "${var.region}"
security_groups = ["${var.region}"]
interface_type = "efa"
count = "2"
}
resource "aws_instance" "ec2_instance" {
count = "1"
ami = "${var.instance_ami}"
instance_type = "dl1.24xlarge"
key_name = "${var.key_name}"
network_interface {
device_index = 0
network_interface_id = "${element(aws_network_interface.ec2_ani.*.id, 0)}"
}
network_interface {
device_index = 1
network_interface_id = "${element(aws_network_interface.ec2_ani.*.id, 1)}"
}
}
Expected Behavior
To be created 2 EFA network interfaces, and an ec2 instance with 2 attachments to those network interfaces
Actual Behavior
│ Error: Error launching source instance: AttachmentLimitExceeded: EFA interface count 2 exceeds allowed limit for dl1.24xlarge
│ status code: 400, request id: a720dc77-5066-4542-a74d-db30f26a2c14
Steps to Reproduce
- Create terraform manifest main.tf with context above
terraform apply
Important Factoids
Commenting out the above interface_type
from value - will recreate 2 ENA network interfaces and attach them to the instance just fine. The issue comes only with the EFA network interface.
dl1.24xlarge should support up to 4 network cards, this behavior indeed works through the UI, I do manage to launch a dl1.24xlarge instance with 4 EFA network cards.