Skip to content

Commit 091459e

Browse files
authored
Merge pull request #51 from awslabs/dev
Bump crate version to 0.3.3
2 parents 1e4067c + 38d8b0b commit 091459e

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aws-lambda-adapter"
3-
version = "0.3.2"
3+
version = "0.3.3"
44
authors = ["Harold Sun <[email protected]>"]
55
edition = "2021"
66

README.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ To use Lambda Web Adapter with docker images, package your web app (http api) in
1919
By default, Lambda Web Adapter assumes the web app is listening on port 8080. If not, you can specify the port via [configuration](#Configurations).
2020

2121
```dockerfile
22-
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.3.2 /lambda-adapter /opt/extensions/lambda-adapter
22+
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.3.3 /lambda-adapter /opt/extensions/lambda-adapter
2323
```
2424

2525
Pre-compiled Lambda Web Adapter binaries are provided in ECR public repo: [public.ecr.aws/awsguru/aws-lambda-adapter](https://gallery.ecr.aws/awsguru/aws-lambda-adapter).
@@ -29,8 +29,8 @@ Below is a Dockerfile for [an example nodejs application](examples/expressjs).
2929

3030
```dockerfile
3131
FROM public.ecr.aws/docker/library/node:16.13.2-stretch-slim
32-
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.3.2 /lambda-adapter /opt/extensions/lambda-adapter
33-
EXPOSE 8080
32+
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.3.3 /lambda-adapter /opt/extensions/lambda-adapter
33+
ENV PORT=7000
3434
WORKDIR "/var/task"
3535
ADD src/package.json /var/task/package.json
3636
ADD src/package-lock.json /var/task/package-lock.json
@@ -45,25 +45,34 @@ This works with any base images except AWS managed base images. To use AWS manag
4545

4646
AWS Lambda Web Adapter also works with AWS managed Lambda runtimes. You need to do three things:
4747

48-
1. attach Lambda Web Adapter layer to your function.
49-
1. x86_64: `arn:aws:lambda:${AWS::Region}:753240598075:layer:LambdaAdapterLayerX86:2`
50-
2. arm64: `arn:aws:lambda:${AWS::Region}:753240598075:layer:LambdaAdapterLayerArm64:2`
51-
2. configure Lambda environment variable `AWS_LAMBDA_EXEC_WRAPPER` to `/opt/bootstrap`.
48+
1. attach Lambda Web Adapter layer to your function.
49+
1. x86_64: `arn:aws:lambda:${AWS::Region}:753240598075:layer:LambdaAdapterLayerX86:3`
50+
2. arm64: `arn:aws:lambda:${AWS::Region}:753240598075:layer:LambdaAdapterLayerArm64:3`
51+
2. configure Lambda environment variable `AWS_LAMBDA_EXEC_WRAPPER` to `/opt/bootstrap`.
5252
3. set function handler to your web application start up script. e.g. `run.sh`.
5353

5454
For details, please check out [the example nodejs application](examples/expressjs-zip).
5555

56+
### Readiness Check
57+
58+
When a new Lambda Execution Environment starts up, Lambda Web Adapter will boot up as a Lambda Extension, followed by the web application.
59+
60+
Lambda Web Adapter will send HTTP GET requests to the web application at `http://127.0.0.1:{READINESS_CHECK_PORT}{READINESS_CHECK_PATH}`.
61+
62+
Lambda Web Adapter will retry this request every 10 milliseconds until the web application returns a successful response (http status code 2xx) or the function times out.
63+
64+
After passing readiness check, Lambda Web Adapter will start Lambda Runtime and forward the invokes to the web application.
5665

5766
### Configurations
5867

5968
The readiness check port/path and traffic port can be configured using environment variables. These environment variables can be defined either within docker file or as Lambda function configuration.
6069

61-
|Environment Variable| Description | Default |
62-
|--------------------|-----------------------------------------------|--------------|
63-
|READINESS_CHECK_PORT| readiness check port | 8080 |
64-
|READINESS_CHECK_PATH| readiness check path | / |
65-
|PORT | traffic port | 8080 |
66-
|REMOVE_BASE_PATH | the base path to be removed from request path | empty string |
70+
|Environment Variable| Description | Default |
71+
|--------------------|------------------------------------------------------------|---------|
72+
|PORT | traffic port | "8080" |
73+
|READINESS_CHECK_PORT| readiness check port, default to the fraffic port | PORT |
74+
|READINESS_CHECK_PATH| readiness check path | "/" |
75+
|REMOVE_BASE_PATH | (optional) the base path to be removed from request path | None |
6776

6877
**REMOVE_BASE_PATH** - The value of this environment variable tells the adapter whether the application is running under a base path.
6978
For example, you could have configured your API Gateway to have a /orders/{proxy+} and a /catalog/{proxy+} resource.

0 commit comments

Comments
 (0)