def METHOD_NAME(name, attributes, region=None, key=None, keyid=None, profile=None):
    """
    Ensure the cloudwatch alarm exists.
    name
        Name of the alarm
    attributes
        A dict of key/value cloudwatch alarm attributes.
    region
        Region to connect to.
    key
        Secret key to be used.
    keyid
        Access key to be used.
    profile
        A dict with region, key and keyid, or a pillar key (string)
        that contains a dict with region, key and keyid.
    """
    ret = {"name": name, "result": True, "comment": "", "changes": {}}
    alarm_details = __salt__["boto_cloudwatch.get_alarm"](
        name, region, key, keyid, profile
    )
    # Convert to arn's
    for k in ["alarm_actions", "insufficient_data_actions", "ok_actions"]:
        if k in attributes:
            attributes[k] = __salt__["boto_cloudwatch.convert_to_arn"](
                attributes[k], region, key, keyid, profile
            )
    # Diff the alarm_details with the passed-in attributes, allowing for the
    # AWS type transformations
    difference = []
    if alarm_details:
        for k, v in attributes.items():
            if k not in alarm_details:
                difference.append("{}={} (new)".format(k, v))
                continue
            v = salt.utils.data.decode(v)
            v2 = salt.utils.data.decode(alarm_details[k])
            if v == v2:
                continue
            if isinstance(v, str) and v == v2:
                continue
            if isinstance(v, float) and v == float(v2):
                continue
            if isinstance(v, int) and v == int(v2):
                continue
            if isinstance(v, list) and sorted(v) == sorted(v2):
                continue
            difference.append("{}='{}' was: '{}'".format(k, v, v2))
    else:
        difference.append("new alarm")
    create_or_update_alarm_args = {
        "name": name,
        "region": region,
        "key": key,
        "keyid": keyid,
        "profile": profile,
    }
    create_or_update_alarm_args.update(attributes)
    if alarm_details:  # alarm is present.  update, or do nothing
        # check to see if attributes matches is_present. If so, do nothing.
        if len(difference) == 0:
            ret["comment"] = "alarm {} present and matching".format(name)
            return ret
        if __opts__["test"]:
            msg = "alarm {} is to be created/updated.".format(name)
            ret["comment"] = msg
            ret["result"] = None
            return ret
        result = __salt__["boto_cloudwatch.create_or_update_alarm"](
            **create_or_update_alarm_args
        )
        if result:
            ret["changes"]["diff"] = difference
        else:
            ret["result"] = False
            ret["comment"] = "Failed to create {} alarm".format(name)
    else:  # alarm is absent. create it.
        if __opts__["test"]:
            msg = "alarm {} is to be created/updated.".format(name)
            ret["comment"] = msg
            ret["result"] = None
            return ret
        result = __salt__["boto_cloudwatch.create_or_update_alarm"](
            **create_or_update_alarm_args
        )
        if result:
            ret["changes"]["new"] = attributes
        else:
            ret["result"] = False
            ret["comment"] = "Failed to create {} alarm".format(name)
    return ret