mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
fix(ec2): name launch template network interface groups groupId on the wire (#7138)
LaunchTemplateInstanceNetworkInterfaceSpecification.Groups is a GroupIdStringList whose members are named groupId, not item. aws-sdk-go-v2 reads only groupId, so Terraform saw security_groups as empty and planned an update every time.
This commit is contained in:
1 parent
89ecb594e1
commit
52055654a7
2 files changed
+7
-2
No files matched your search
@@ -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");
|
||||
}
|
||||
|
||||
+6
-1
@@ -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("<groupSet><groupId>sg-1111111111111111a</groupId>"), raw);
|
||||
assertFalse(raw.contains("<groupSet><item>"), 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");
|
||||
|
||||
Reference in new issue
Block a user