diff --git a/cloud/amazon/ec2_vol.py b/cloud/amazon/ec2_vol.py index 712be248af3..0d275cc91d7 100644 --- a/cloud/amazon/ec2_vol.py +++ b/cloud/amazon/ec2_vol.py @@ -436,11 +436,11 @@ def main(): # Delaying the checks until after the instance check allows us to get volume ids for existing volumes # without needing to pass an unused volume_size - if not volume_size and not (id or name): - module.fail_json(msg="You must specify an existing volume with id or name or a volume_size") + if not volume_size and not (id or name or snapshot): + module.fail_json(msg="You must specify volume_size or identify an existing volume by id, name, or snapshot") - if volume_size and id: - module.fail_json(msg="Cannot specify volume_size and id") + if volume_size and (id or snapshot): + module.fail_json(msg="Cannot specify volume_size together with id or snapshot") if state == 'absent': delete_volume(module, ec2)