logger.debug("<< created securityGroup(%s)", securityGroup);
for (int port : zoneSecurityGroupNameAndPorts.getPorts()) {
authorizeGroupToItselfAndAllIPsToTCPPort(api.get(), securityGroup, port);
}
return new SecurityGroupInZone(api.get().get(securityGroup.getId()), zoneId);
} catch (IllegalStateException e) {
logger.trace("<< trying to find securityGroup(%s): %s", zoneSecurityGroupNameAndPorts, e.getMessage());
SecurityGroup group = find(api.get().list(), nameEquals(zoneSecurityGroupNameAndPorts
.getName()));
logger.debug("<< reused securityGroup(%s)", group.getId());
return new SecurityGroupInZone(group, zoneId);
}
}