While a lambda is still processing (archive unpacking etc), the lambda state should be set to "Pending" (currently "Active") and invocations to that lambda should fail (currently, it can end up in a inconsistent state in this case, like lambdas being executed without layers).

Lambda state should reflect the current internal state, and invocations should fail if not active.
return jsonify(data)
@app.route("/<version>/tags/<arn>", methods=["GET"])
def list_tags(version, arn):
    region = LambdaRegion.get()
    lambda_function = region.lambdas.get(arn)
    if not lambda_function:
        return not_found_error(arn)
    result = {"Tags": lambda_function.tags}
    return jsonify(result)
@app.route("/<version>/tags/<arn>", methods=["POST"])
def tag_resource(version, arn):
    region = LambdaRegion.get()
    data = json.loads(request.data)
    tags = data.get("Tags", {})
    if tags:
        lambda_function = region.lambdas.get(arn)
        if not lambda_function:
            return not_found_error(arn)
        if lambda_function:
            lambda_function.tags.update(tags)
    return jsonify({})
@app.route("/<version>/tags/<arn>", methods=["DELETE"])
def untag_resource(version, arn):
    region = LambdaRegion.get()
    tag_keys = request.args.getlist("tagKeys")
    lambda_function = region.lambdas.get(arn)
    if not lambda_function:
        return not_found_error(arn)
    for tag_key in tag_keys:
        lambda_function.tags.pop(tag_key, None)