diff --git a/lib/ansible/modules/cloud/amazon/ec2_instance_facts.py b/lib/ansible/modules/cloud/amazon/ec2_instance_facts.py index 692f10c65b8..ce99744b7e4 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_instance_facts.py +++ b/lib/ansible/modules/cloud/amazon/ec2_instance_facts.py @@ -500,8 +500,7 @@ def list_ec2_instances(connection, module): # Turn the boto3 result in to ansible friendly tag dictionary for instance in snaked_instances: - if 'tags' in instance: - instance['tags'] = boto3_tag_list_to_ansible_dict(instance['tags']) + instance['tags'] = boto3_tag_list_to_ansible_dict(instance.get('tags', []), 'key', 'value') module.exit_json(instances=snaked_instances)