diff --git a/src/main/java/io/github/hectorvent/floci/services/ec2/Ec2QueryHandler.java b/src/main/java/io/github/hectorvent/floci/services/ec2/Ec2QueryHandler.java index 3b651cb625..8f3a7df7ab 100644 --- a/src/main/java/io/github/hectorvent/floci/services/ec2/Ec2QueryHandler.java +++ b/src/main/java/io/github/hectorvent/floci/services/ec2/Ec2QueryHandler.java @@ -5758,7 +5758,7 @@ public class Ec2QueryHandler { if (!networkInterface.getGroups().isEmpty()) { xml.start("groupSet"); for (String group : networkInterface.getGroups()) { - xml.elem("item", group); + xml.elem("groupId", group); } xml.end("groupSet"); } diff --git a/src/test/java/io/github/hectorvent/floci/services/ec2/Ec2LaunchTemplateFieldsIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/ec2/Ec2LaunchTemplateFieldsIntegrationTest.java index 0eb897a505..fa53c6d610 100644 --- a/src/test/java/io/github/hectorvent/floci/services/ec2/Ec2LaunchTemplateFieldsIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/ec2/Ec2LaunchTemplateFieldsIntegrationTest.java @@ -12,6 +12,7 @@ import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.equalTo; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Regression tests for CreateLaunchTemplate discarding nearly all of RequestLaunchTemplateData. @@ -199,8 +200,12 @@ class Ec2LaunchTemplateFieldsIntegrationTest { .body(DATA + "networkInterfaceSet.item.subnetId", equalTo("subnet-0123456789abcdef0")) .body(DATA + "networkInterfaceSet.item.associatePublicIpAddress", equalTo("true")) .body(DATA + "networkInterfaceSet.item.deleteOnTermination", equalTo("true")) - .body(DATA + "networkInterfaceSet.item.groupSet.item", + .body(DATA + "networkInterfaceSet.item.groupSet.groupId", contains("sg-1111111111111111a", "sg-2222222222222222b")); + // GroupIdStringList members are named groupId on the wire; aws-sdk-go-v2 reads only that tag. + String raw = describeBody(name); + assertTrue(raw.contains("sg-1111111111111111a"), raw); + assertFalse(raw.contains(""), raw); // Not promoted to the top level: that promotion is what made the block disappear. assertFalse(describeBody(name).contains("securityGroupIdSet"), "interface groups must not be hoisted into top-level SecurityGroupIds");