diff --git a/vpc-interface-endpoint/README.md b/vpc-interface-endpoint/README.md index 54c9d3e..987c8f6 100644 --- a/vpc-interface-endpoint/README.md +++ b/vpc-interface-endpoint/README.md @@ -53,6 +53,7 @@ No modules. | [aws_vpc_endpoint.interface_endpoint](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_endpoint) | resource | | [aws_arn.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/arn) | data source | | [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source | +| [aws_network_interface.vpce_interfaces](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/network_interface) | data source | | [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source | | [aws_vpc_endpoint_service.interface_endpoint](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc_endpoint_service) | data source | diff --git a/vpc-interface-endpoint/outputs.tf b/vpc-interface-endpoint/outputs.tf index 8e8cc3b..9aff205 100644 --- a/vpc-interface-endpoint/outputs.tf +++ b/vpc-interface-endpoint/outputs.tf @@ -1,7 +1,7 @@ -# data "aws_network_interface" "vpce_interfaces" { -# for_each = toset(aws_vpc_endpoint.interface_endpoint.network_interface_ids) -# id = each.key -# } +data "aws_network_interface" "vpce_interfaces" { + for_each = toset(aws_vpc_endpoint.interface_endpoint.network_interface_ids) + id = each.key +} output "vpce_service_info" { description = "VPC Interface Endpoint information for service" @@ -13,6 +13,6 @@ output "vpce_service_info" { "subnet_ids" = aws_vpc_endpoint.interface_endpoint.subnet_ids, "network_interface_ids" = aws_vpc_endpoint.interface_endpoint.network_interface_ids, "subnet_interface_id_map" = zipmap(tolist(aws_vpc_endpoint.interface_endpoint.subnet_ids), tolist(aws_vpc_endpoint.interface_endpoint.network_interface_ids)), - # "subnet_interface_ip_map" = zipmap(tolist(aws_vpc_endpoint.interface_endpoint.subnet_ids), [for k, v in data.aws_network_interface.vpce_interfaces : v.private_ip]), + "subnet_interface_ip_map" = zipmap(tolist(aws_vpc_endpoint.interface_endpoint.subnet_ids), [for k, v in data.aws_network_interface.vpce_interfaces : v.private_ip]), } }