EC2 Instance with 2 Interfaces in 2 private subnets

Hi

I have created this terraform template referencing a variable file. Basically I want to create 2 Instances which will have two interfaces, and each of these interfaces will reside in two seperate subnet. My brain is hurting to try figure it out. What is happening subnet ID is that it is applying subnet 1 to instance1 and subnet 2 to instance2. I want the instance to launch in subnet 1 and subnet 2. eth0 pointing to subnet xxxx and eth1 pointing to subnet bbbb. Hope this makes sense. Thanks

Here is my code

vars.tf

variable “ami”
{default = “ami-xxxx”
}

variable “instance_count” {
default = “2”
}
variable “instance_tags” {
type = “list”
default = [“testpc1”, “testpc22”]
}
variable “subnet_id” {
type = “string”
default = “subnet-xxxxxxx”
}

variable “subnet_ids” {
description = “A list of VPC Subnet IDs to launch in”
type = “list”
default = [“subnet-xxxx” ,“subnet-bbbb”]
}

variable “instance_type” {
default = “t2.micro”
}

main.tf

resource “aws_instance” “my-instance” {
count = “{var.instance\_count}" ami = "{var.ami}”
subnet_id = “{element(var.subnet\_ids, count.index)}" instance\_type = "{var.instance_type}”

tags = {
Name = “${element(var.instance_tags, count.index)}”
}
}

I have also tried this in a new main.tf
It creates two instances and it creates two network interfaces but it fails because it only creates two interfaces and attaches it to the first instance and states that the interface is in use. How do i ensure that two new interfaces are created and added to the second instance

resource “aws_network_interface” “CDE-MGMT” {
subnet_id = “subnet-xxxx”
tags = {
Name = “CDE-MGMT” }
}

resource “aws_network_interface” “CDE-PROD” {
subnet_id = “subnet-xxxx”
tags = { Name = “CDE-PROD” }

}
resource “aws_instance” “SQL” {
count = 2
ami = “ami-xxxx”
instance_type = “t2.micro”

network_interface {
network_interface_id = "${[aws_network_interface.CDE-MGMT.id]
device_index = 0
}

network_interface {
network_interface_id = "${[aws_network_interface.CDE-PROD.id]
device_index = 1
}

tags = {
Name = “SQL”
}
}
output “SQL Private IP” {
value = “${aws_instance.SQL.*.private_ip}”
}