fix(ec2): preserve VPC endpoint IP address types (#5427)

* fix(ec2): preserve SDK endpoint compatibility

Return endpoint states that AWS SDK clients recognize and preserve the
requested address family, so endpoint create and describe responses
round-trip correctly. Keep documented state-filter values working.

* fix(ec2): preserve saved endpoint states and reject invalid IP types

* fix(ec2): reject unsupported endpoint IP types safely

* fix(ec2): retain endpoint states and address-type metadata

---------

Co-authored-by: Jason van Zyl <jason@vanzyl.ca>
This commit is contained in:
David PhillipsandJason van Zyl authored and GitHub committed 2026-10-11 00:34:40 -04:00
1 parent ad1fbbc9b9
commit 47d1e10e5c
7 files changed
+124 -4

No files matched your search

@@ -1027,6 +1027,8 @@ class Ec2Tests {
.securityGroupIds(ownGroupId)
.build());
endpointId = created.vpcEndpoint().vpcEndpointId();
assertThat(created.vpcEndpoint().ipAddressType()).isEqualTo(IpAddressType.IPV4);
assertThat(created.vpcEndpoint().stateAsString()).isEqualTo("available");
// Asserted on the CREATE response and again on DESCRIBE, because Terraform
// reads the ids from one and then re-reads them from the other between plan
@@ -1039,6 +1041,8 @@ class Ec2Tests {
DescribeVpcEndpointsResponse described = ec2.describeVpcEndpoints(
DescribeVpcEndpointsRequest.builder().vpcEndpointIds(endpointId).build());
VpcEndpoint ep = described.vpcEndpoints().get(0);
assertThat(ep.ipAddressType()).isEqualTo(IpAddressType.IPV4);
assertThat(ep.stateAsString()).isEqualTo("available");
assertThat(ep.networkInterfaceIds())
.as("DescribeVpcEndpoints response")