def METHOD_NAME():
    client = boto3.client("iot", region_name="ap-northeast-1")
    # no such rule
    with pytest.raises(ClientError) as ex:
        client.replace_topic_rule(ruleName=name, topicRulePayload=payload)
    error_code = ex.value.response["Error"]["Code"]
    assert error_code == "ResourceNotFoundException"
    client.create_topic_rule(ruleName=name, topicRulePayload=payload)
    my_payload = payload.copy()
    my_payload["description"] = "new-description"
    client.replace_topic_rule(ruleName=name, topicRulePayload=my_payload)
    rule = client.get_topic_rule(ruleName=name)
    assert rule["rule"]["ruleName"] == name
    assert rule["rule"]["description"] == my_payload["description"]