This project provides a working configuration of NGINX configured to act as an authenticating gateway for the AWS Lambda service. This allows you to proxy a private Lambda function without requiring users to authenticate to it via AWS signature.
Within the proxy layer of nginx-lambda-gateway
, additional functionality can be configured such as:
- Providing an AWS signature based authentication gateway using an alternative authentication system to AWS Lambda functions
- For internal/micro services that can't authenticate against the AWS Lambda functions (e.g. don't have libraries available) the gateway can provide a means to accessing Lambda functions without authentication
- Protecting Lambda functions from arbitrary public access
- For internal/micro services that can't authenticate against the AWS Lambda functions
- Rate limiting AWS Lambda functions
- Authenticating users to authorize AWS Lambda functions with a OIDC
- Protecting AWS Lambda functions with a WAF
Refer to the Getting Started Guide for how to build and run the gateway.
nginx-lambda-gateway
β
βββ common
β βββ etc
β β βββ nginx default nginx-lambda-gateway configuration
β β βββ ssl contains certificates and NGINX Plus license
β βββ lambda-core
β β βββ awscredentials.js common lib to read and write AWS credentials
β β βββ awssig2.js common lib to build AWS signature v2
β β βββ awssig4.js common lib to build AWS signature v4
β β βββ lambdagateway.js common lib to integrate the Lambda from NGINX
β β βββ lambda_ngx_apis.conf API endpoints config for nginx-lambda-gateway
β β βββ lambda_ngx_http.conf common config under NGINX http directive
β β βββ lambda_ngx_proxy.conf common config to be set before proxy_pass
β β βββ utils.js common lib to be reused by all NJS codebase
β βββ lambda-emulator proxy for Lambda Runtime API to locally test
β
βββ docker
β βββ Dockerfile.oss for NGINX OSS to act as a Lambda gateway
β βββ Dockerfile.plus for NGINX Plus to act as a Lambda gateway
β
βββ docker-compose.yml Docker config to build and run nginx-lambda-gateway
βββ settings.env Docker env file
β
βββ docs contains documentation about the project
β
βββ examples
β βββ 01-all-lambda-function-arns NGINX proxy to all Lambda function ARNs
β βββ 02-one-lambda-function-arn NGINX proxy to one Lambda function ARN
β βββ 03-one-lambda-function-url NGINX proxy to one Lambda function URL
β βββ 04-lambda-function-arn-url NGINX proxy to both of Lambda function ARN and URL
β
βββ tests test launcher and unit/integration test codebase
β
βββ Makefile automate to build/start/stop nginx-lambda-gateway
Refer to the Development Guide for more information about extending or testing the gateway.
All code include is licensed under the Apache 2.0 license.