diff --git a/lib/ansible/modules/cloud/amazon/ec2.py b/lib/ansible/modules/cloud/amazon/ec2.py index 918918b5871..45a81e0cd74 100644 --- a/lib/ansible/modules/cloud/amazon/ec2.py +++ b/lib/ansible/modules/cloud/amazon/ec2.py @@ -600,7 +600,7 @@ def find_running_instances_by_count_tag(module, ec2, vpc, count_tag, zone=None): for res in reservations: if hasattr(res, 'instances'): for inst in res.instances: - if inst.state == 'terminated': + if inst.state == 'terminated' or inst.state == 'shutting-down': continue instances.append(inst)