fix(ec2): include AttachTime in describe-instances network interface response (#1214)

This commit is contained in:
Samarth Tikotkar authored and GitHub committed 2026-06-07 00:26:36 -05:00
1 parent 43f4451834
commit 882fd03457
4 files changed
+48 -11

No files matched your search

@@ -1375,8 +1375,11 @@ public class Ec2QueryHandler {
.start("attachment")
.elem("attachmentId", eni.getAttachmentId())
.elem("deviceIndex", String.valueOf(eni.getDeviceIndex()))
.elem("status", "attached")
.elem("deleteOnTermination", "true")
.elem("status", "attached");
if (eni.getAttachTime() != null) {
xml.elem("attachTime", eni.getAttachTime());
}
xml.elem("deleteOnTermination", "true")
.end("attachment")
.start("privateIpAddressesSet")
.start("item")
@@ -277,6 +277,9 @@ public class Ec2Service {
eni.setGroups(new ArrayList<>(sgIdentifiers));
eni.setAttachmentId("eni-attach-" + randomHex(17));
eni.setDeviceIndex(0);
if (inst.getLaunchTime() != null) {
eni.setAttachTime(ISO_FMT.format(inst.getLaunchTime()));
}
inst.getNetworkInterfaces().add(eni);
// Root EBS volume
@@ -23,6 +23,7 @@ public class InstanceNetworkInterface {
private List<GroupIdentifier> groups = new ArrayList<>();
private String attachmentId;
private int deviceIndex;
private String attachTime;
public InstanceNetworkInterface() {}
@@ -64,4 +65,7 @@ public class InstanceNetworkInterface {
public int getDeviceIndex() { return deviceIndex; }
public void setDeviceIndex(int deviceIndex) { this.deviceIndex = deviceIndex; }
public String getAttachTime() { return attachTime; }
public void setAttachTime(String attachTime) { this.attachTime = attachTime; }
}