[cloud] Fix ASG updates when LaunchConfigurationName does not exist for ASG instances

when replacing launch configurations the previous launch config is removed from any instances (#26966)
This commit is contained in:
Sloane Hertel 2017-07-18 16:21:11 -04:00 committed by Ryan Brown
parent 5b109506c4
commit d971629062

View file

@ -423,7 +423,7 @@ def get_properties(autoscaling_group, module):
for i in autoscaling_group_instances:
instance_facts[i['InstanceId']] = {'health_status': i['HealthStatus'],
'lifecycle_state': i['LifecycleState'],
'launch_config_name': i['LaunchConfigurationName']}
'launch_config_name': i.get('LaunchConfigurationName')}
if i['HealthStatus'] == 'Healthy' and i['LifecycleState'] == 'InService':
properties['viable_instances'] += 1
if i['HealthStatus'] == 'Healthy':