if (!(getLocation() instanceof JcloudsSshMachineLocation)) {
log.info("{} not running in a JcloudsSshMachineLocation, not configuring extra security groups", entity);
return;
}
JcloudsSshMachineLocation location = (JcloudsSshMachineLocation) getLocation();
JcloudsLocationSecurityGroupCustomizer customizer = JcloudsLocationSecurityGroupCustomizer.getInstance(getEntity().getApplicationId());
Collection<IpPermission> permissions = getIpPermissions(customizer);
log.debug("Applying custom security groups to {}: {}", location, permissions);
customizer.addPermissionsToLocation(location, permissions);
}
}