Unable to reference a network interface private_ips index

Hi,

Trying to add an elastic IP to a secondary private IP of a network interface but unable to access any of the values in the private_ips attribute. I don’t know if I’ve found a bug or doing something wrong. Any help would be greatly appreciated!

resource “aws_network_interface” “external” {

count = var.instance_count

subnet_id = data.aws_subnet.external_subnet.id

private_ips_count = 1

}

resource “aws_eip” “virtual_server” {

count = var.instance_count

network_interface = aws_network_interface.external[count.index].id

associate_with_private_ip = aws_network_interface.external[count.index].private_ips[1]

}