Imported few validations and elastic_ip related code from old plugin.