Add aws_vpc_endpoint ENI to route table


I’m trying to add an aws_vpc_endpoint ENI as a route table next-hop, in the same module.

I’m using the network_interface_ids from aws_vpc_endpoint in my aws_route_table but each time it errors with
“Inappropriate value for attribute “network_interface_id”: string required.”

My latest config snippets are below:
resource “aws_vpc_endpoint” “vpce1” {

resource “aws_route_table” “TransitVPC-USW2-AttSubnetRT1” {
vpc_id =
route {
cidr_block = “”
network_interface_id = data.aws_vpc_endpoint.data_vpce1.network_interface_ids
data “aws_vpc_endpoint” “data_vpce1” {
id =