Skip to content

Commit 64ec0d7

Browse files
committed
.
1 parent db1b662 commit 64ec0d7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

wrapper/src/test/java/integration/util/AuroraTestUtility.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,16 +2286,21 @@ public void securityGroupRulesCleanUp() {
22862286
}
22872287

22882288
for (SecurityGroupRule rule : rulesResponse.securityGroupRules()) {
2289-
if (rule.description() != null && rule.description().startsWith("Test run at ")) {
2289+
if (!rule.isEgress() && rule.description() != null && rule.description().startsWith("Test run at ")) {
22902290
try {
22912291
String instantStr = rule.description().replaceAll("Test run at ", "");
22922292
Instant createdAt = Instant.parse(instantStr);
22932293
if (createdAt.plus(12, ChronoUnit.HOURS).isAfter(Instant.now())) {
22942294
continue;
22952295
}
22962296

2297-
ec2Client.revokeSecurityGroupIngress(
2298-
RevokeSecurityGroupIngressRequest.builder().securityGroupRuleIds(rule.securityGroupRuleId()).build());
2297+
LOGGER.finest("Deleting security group rule: " + rule.securityGroupRuleId());
2298+
try {
2299+
ec2Client.revokeSecurityGroupIngress(
2300+
RevokeSecurityGroupIngressRequest.builder().securityGroupRuleIds(rule.securityGroupRuleId()).build());
2301+
} catch (Exception ex) {
2302+
LOGGER.warning("Error deleting security group rule: " + ex.getMessage());
2303+
}
22992304

23002305
} catch (Exception ex) {
23012306
LOGGER.warning(ex.getMessage());

0 commit comments

Comments
 (0)