Commit Graph
1 Commits
Author SHA1 Message Date
Andre Kurait 1820d6470d fix(ec2): preserve security group deletion scope and dependencies (#7920)
* fix(ec2): preserve security group deletion scope and dependencies

Coordinate group publication, attachment and deletion, preserve instance/interface group state, and reject invalid DryRun values before deletion.

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(ec2): tolerate absent persisted group dependency fields

Keep unknown-state instance attachments blocking deletion while treating absent dependency collections as empty. Cover all nullable scan fields and missing identifiers without changing normal dependency semantics.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(ec2): roll back failed security group creation

Retain the default rule identity before publication and compensate both group and rule writes when either store fails. Preserve the original exception and record cleanup failures without skipping the remaining cleanup.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(ec2): serialize group rule references with deletion

Acquire the regional topology monitor before the source group monitor while resolving and publishing ingress and egress rules. Keep runtime reconciliation outside the mutation locks and preserve existing unknown-reference compatibility.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(ec2): retain groups used by Instance Connect endpoints

Reject deletion before mutation when an Instance Connect endpoint uses the group. Return CannotDelete for default groups and reuse shared SDK clients in the existing fixtures.

Signed-off-by: Andre Kurait <akurait@amazon.com>

* refactor(ec2): share resource locks and deletion race helpers

Reuse the reference-counted lock lifecycle for volume operations and instance group assignments. Keep scoped keys and lock ordering unchanged. Reuse deletion tasks and blocked-or-done observations without weakening race assertions.

Signed-off-by: Andre Kurait <akurait@amazon.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-11-12 20:31:14 -04:00