diff --git a/lib/ansible/modules/cloud/amazon/ec2_eip.py b/lib/ansible/modules/cloud/amazon/ec2_eip.py old mode 100644 new mode 100755 index 2d6f16dea85..535e10e12f9 --- a/lib/ansible/modules/cloud/amazon/ec2_eip.py +++ b/lib/ansible/modules/cloud/amazon/ec2_eip.py @@ -365,10 +365,7 @@ def main(): module = AnsibleModule( argument_spec=argument_spec, - supports_check_mode=True, - required_together=[ - ('device_id', 'private_ip_address'), - ] + supports_check_mode=True ) if not HAS_BOTO: @@ -386,6 +383,10 @@ def main(): reuse_existing_ip_allowed = module.params.get('reuse_existing_ip_allowed') release_on_disassociation = module.params.get('release_on_disassociation') + # Parameter checks + if private_ip_address is not None and device_id is None: + module.fail_json(msg="parameters are required together: ('device_id', 'private_ip_address')") + if instance_id: warnings = ["instance_id is no longer used, please use device_id going forward"] is_instance = True