filter: AWS Lambda filter (initial version) (#10260)
This filter transform HTTP requests to AWS Lambda invocations. The filter supports pass-through only. Meaning, the request body is passed to Lambda as is. Note: Lambda requires the request to be in JSON format. In a later iteration, we'll wrap the headers the body in a JSON string before passing it to Lambda. The filter requires the ARN of the Lambda function and supports per-filter-config. When the per-filter configuration is used, the target cluster must be tagged with specific metadata. This indicates to the filter whether to process the request or to skip it. Lambda supports two invocation modes: - Synchronous (Request-Response) - Asynchronous (Event) This initial version of the filter supports the synchronous mode only. In a later iteration I'll add support for the asynchronous (Event-based) version. Signed-off-by: Marco Magdy <mmagdy@gmail.com> Mirrored from https://github.com/envoyproxy/envoy @ 807401004d500899e9aa4c78fce007cf83b538cdmaster-ci-test
parent
823ee01295
commit
fc9d746a57
6 changed files with 98 additions and 0 deletions
@ -0,0 +1,9 @@ |
||||
# DO NOT EDIT. This file is generated by tools/proto_sync.py. |
||||
|
||||
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") |
||||
|
||||
licenses(["notice"]) # Apache 2 |
||||
|
||||
api_proto_package( |
||||
deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"], |
||||
) |
@ -0,0 +1,36 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.config.filter.http.aws_lambda.v2alpha; |
||||
|
||||
import "udpa/annotations/status.proto"; |
||||
|
||||
import "udpa/annotations/migrate.proto"; |
||||
import "validate/validate.proto"; |
||||
|
||||
option java_package = "io.envoyproxy.envoy.config.filter.http.aws_lambda.v2alpha"; |
||||
option java_outer_classname = "AwsLambdaProto"; |
||||
option java_multiple_files = true; |
||||
option (udpa.annotations.file_migrate).move_to_package = |
||||
"envoy.extensions.filters.http.aws_lambda.v3"; |
||||
option (udpa.annotations.file_status).work_in_progress = true; |
||||
|
||||
// [#protodoc-title: AWS Lambda] |
||||
// AWS Lambda :ref:`configuration overview <config_http_filters_aws_lambda>`. |
||||
// [#extension: envoy.filters.http.aws_lambda] |
||||
|
||||
// AWS Lambda filter config |
||||
message Config { |
||||
// The ARN of the AWS Lambda to invoke when the filter is engaged |
||||
// Must be in the following format: |
||||
// arn:<partition>:lambda:<region>:<account-number>:function:<function-name> |
||||
string arn = 1 [(validate.rules).string = {min_len: 1}]; |
||||
|
||||
// Whether to transform the request (headers and body) to a JSON payload or pass it as is. |
||||
bool payload_passthrough = 2; |
||||
} |
||||
|
||||
// Per-route configuration for AWS Lambda. This can be useful when invoking a different Lambda function or a different |
||||
// version of the same Lambda depending on the route. |
||||
message PerRouteConfig { |
||||
Config invoke_config = 1; |
||||
} |
@ -0,0 +1,12 @@ |
||||
# DO NOT EDIT. This file is generated by tools/proto_sync.py. |
||||
|
||||
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") |
||||
|
||||
licenses(["notice"]) # Apache 2 |
||||
|
||||
api_proto_package( |
||||
deps = [ |
||||
"//envoy/config/filter/http/aws_lambda/v2alpha:pkg", |
||||
"@com_github_cncf_udpa//udpa/annotations:pkg", |
||||
], |
||||
) |
@ -0,0 +1,38 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.extensions.filters.http.aws_lambda.v3; |
||||
|
||||
import "udpa/annotations/versioning.proto"; |
||||
|
||||
import "validate/validate.proto"; |
||||
|
||||
option java_package = "io.envoyproxy.envoy.extensions.filters.http.aws_lambda.v3"; |
||||
option java_outer_classname = "AwsLambdaProto"; |
||||
option java_multiple_files = true; |
||||
|
||||
// [#protodoc-title: AWS Lambda] |
||||
// AWS Lambda :ref:`configuration overview <config_http_filters_aws_lambda>`. |
||||
// [#extension: envoy.filters.http.aws_lambda] |
||||
|
||||
// AWS Lambda filter config |
||||
message Config { |
||||
option (udpa.annotations.versioning).previous_message_type = |
||||
"envoy.config.filter.http.aws_lambda.v2alpha.Config"; |
||||
|
||||
// The ARN of the AWS Lambda to invoke when the filter is engaged |
||||
// Must be in the following format: |
||||
// arn:<partition>:lambda:<region>:<account-number>:function:<function-name> |
||||
string arn = 1 [(validate.rules).string = {min_len: 1}]; |
||||
|
||||
// Whether to transform the request (headers and body) to a JSON payload or pass it as is. |
||||
bool payload_passthrough = 2; |
||||
} |
||||
|
||||
// Per-route configuration for AWS Lambda. This can be useful when invoking a different Lambda function or a different |
||||
// version of the same Lambda depending on the route. |
||||
message PerRouteConfig { |
||||
option (udpa.annotations.versioning).previous_message_type = |
||||
"envoy.config.filter.http.aws_lambda.v2alpha.PerRouteConfig"; |
||||
|
||||
Config invoke_config = 1; |
||||
} |
Loading…
Reference in new issue