def does_role_exist(iam, role_name):
    """Check if the role name exists.

    Parameters
    ----------
    iam: iam client, required
    role_name: string, required

    Returns
    ------
        bool: returns if the role exists
    """
    role_exists = False

    try:
        response = iam.get_role(RoleName=role_name)

        if "Role" in response:
            role_exists = True

    except iam.exceptions.NoSuchEntityException as e:
        role_exists = False

    return role_exists