You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`lambda_http` is a wrapper for HTTP events coming from two different services, Amazon Load Balancer (ALB), and AWS Api Gateway (APIGW). AWS Api Gateway can also send events from three different endpoints, Proxy V1, Proxy V2, and WebSockets. `lambda_http` transforms events from all these sources into native `http::Request` objects, so you can incorporate Rust http semantics into your Lambda functions.
377
+
`lambda_http` is a wrapper for HTTP events coming from two different services, Amazon Load Balancer (ALB), and Amazon Api Gateway (APIGW). Amazon Api Gateway can also send events from three different endpoints, Proxy V1, Proxy V2, and WebSockets. `lambda_http` transforms events from all these sources into native `http::Request` objects, so you can incorporate Rust HTTP semantics into your Lambda functions.
378
378
379
-
By default, `lambda_http` compiles your function to support any of those services, this increases the compile time of your function because we have to generate code for all the sources. In reality, you'll usually put a Lambda function only behind of those sources. You can choose which source to generate code for with feature flags.
379
+
By default, `lambda_http` compiles your function to support any of those services. This increases the compile time of your function because we have to generate code for all the sources. In reality, you'll usually put a Lambda function only behind one of those sources. You can choose which source to generate code for with feature flags.
380
380
381
381
The available features flags for `lambda_http` are the following:
382
382
383
-
-`alb`: for events coming from Amazon Load Balancer.
384
-
-`apigw_v1`: for events coming from API Gateway Proxy V1.
385
-
-`apigw_v2`: for events coming from API Gateway Proxy V2.
386
-
-`apigw_websockets`: for events coming from API Gateway WebSockets.
383
+
-`alb`: for events coming from [Amazon Elastic Load Balancer](https://aws.amazon.com/elasticloadbalancing/).
384
+
-`apigw_rest`: for events coming from [Amazon API Gateway Rest APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-rest-api.html).
385
+
-`apigw_http`: for events coming from [Amazon API Gateway HTTP APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html).
386
+
-`apigw_websockets`: for events coming from [Amazon API Gateway WebSockets](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api.html).
387
387
388
-
If you only want to support one of these sources, you can disable the default features, and enable only the source that you care about in your package's Cargo.toml file. Substitute the dependency line for `lambda_http` for the snippet below, changing the feature that you want to enable:
388
+
If you only want to support one of these sources, you can disable the default features, and enable only the source that you care about in your package's `Cargo.toml` file. Substitute the dependency line for `lambda_http` for the snippet below, changing the feature that you want to enable:
389
389
390
390
```toml
391
391
[dependencies.lambda_http]
392
392
version = "0.5.3"
393
393
default-features = false
394
-
features = ["apigw_v1"]
394
+
features = ["apigw_rest"]
395
395
```
396
396
397
-
This will make your function to compile much faster.
0 commit comments