EC2: Don't count instances in 'shutting-down' as running (#60709)

state: shutting-down is a precursor to terminated and should be treated
as such for exact_count.
Fixes #55955
pull/60860/head
Jill R 5 years ago committed by GitHub
parent 2f05953b52
commit 129e998276
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save