File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
wrapper/src/test/java/integration/util Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff 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 ());
You can’t perform that action at this time.
0 commit comments