def function_arn_to_uri(function_arn):
    """
    This function takes the ARN of a lambda function and
    returns its URI that is used by apigateway to call the
    function.

    For example
    ::

      arn:aws:lambda:us-west-2:756048602902:function:hello_world

    becomes
    ::

      arn:aws:apigateway:us-west-2:lambda:path/2015-03-31
      /functions/arn:aws:lambda:us-west-2:756048602902:function:hello_world/invocations

    :param str function_arn: The ARN of the lambda function.
    :return: The function URI
    :rtype: str
    """
    region = function_arn.split(":")[3]
    return (
        "arn:aws:apigateway:{0}:lambda:path/2015-03-31"
        "/functions/{1}/invocations"
    ).format(
        region, function_arn
    )