diff --git a/lib/ansible/modules/cloud/amazon/iam_role.py b/lib/ansible/modules/cloud/amazon/iam_role.py index e43d797c8d8..bdc4a05fd24 100644 --- a/lib/ansible/modules/cloud/amazon/iam_role.py +++ b/lib/ansible/modules/cloud/amazon/iam_role.py @@ -338,7 +338,7 @@ def create_or_update_role(connection, module): connection.add_role_to_instance_profile(InstanceProfileName=params['RoleName'], RoleName=params['RoleName']) # Check Description update - if not role.get('MadeInCheckMode') and params.get('Description') and role['Description'] != params['Description']: + if not role.get('MadeInCheckMode') and params.get('Description') and role.get('Description') != params['Description']: try: if not module.check_mode: connection.update_role_description(RoleName=params['RoleName'], Description=params['Description'])