fix(ec2): skip terminated instances in DescribeNetworkInterfaces (#1074)

This commit is contained in:
nblomquist authored and GitHub committed 2026-05-28 17:59:00 -05:00
1 parent 34d739edf8
commit 9b436e6c67
1 file changed
+5
@@ -1558,6 +1558,11 @@ public class Ec2Service {
Set<String> foundIds = new HashSet<>();
for (Instance inst : instances.values()) {
if (!inst.getRegion().equals(region)) continue;
if (inst.getState() != null
&& inst.getState().getName() != null
&& "terminated".equals(inst.getState().getName())) {
continue;
}
for (InstanceNetworkInterface eni : inst.getNetworkInterfaces()) {
if (!networkInterfaceIds.isEmpty()
&& !networkInterfaceIds.contains(eni.getNetworkInterfaceId())) {