diff --git a/lib/ansible/modules/cloud/amazon/ec2_group.py b/lib/ansible/modules/cloud/amazon/ec2_group.py index 5b069c19a96..2cdc033e9c7 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_group.py +++ b/lib/ansible/modules/cloud/amazon/ec2_group.py @@ -289,7 +289,8 @@ def main(): if group: '''found a match, delete it''' try: - group.delete() + if not module.check_mode: + group.delete() except Exception as e: module.fail_json(msg="Unable to delete security group '%s' - %s" % (group, e)) else: