Skip to content

docs: development guide for integrating with AWS signature #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions common/lambda-core/awssig2.js

This file was deleted.

17 changes: 17 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

## Integrating with AWS Signature

Update the following files when enhancing `nginx-lambda-gateway` to integrate with AWS signature whenever AWS releases a new version of signature or you have a new PR:

- NGINX Proxy: [`/etc/nginx/conf.d/nginx_lambda_gateway.conf`](../common/etc/nginx/conf.d/nginx_lambda_gateway.conf)
- AWS Credentials Lib: [`/etc/nginx/serverless/awscredentials.js`](../common/lambda-core/awscredentials.js)
- AWS Signature Lib per version:
- [`/etc/nginx/include/awssig4.js`](../common/lambda-core/awssig4.js)
- AWS Lambda Integration Lib: [`/etc/nginx/serverless/lambdagateway.js`](../common/lambda-core/lambdagateway.js)
- Common reusable Lib for all of NJS: [`/etc/nginx/serverless/utils.js`](../common/lambda-core/utils.js)

![](../docs/img/nginx-lambda-gateway-aws-signature-integration.png)

## Extending the Gateway

### Extending gateway configuration

- NGINX API gateway endpoints' configuration for Lambda integration: [`/etc/nginx/serverless/lambda_ngx_apis.conf`](../common/lambda-core/lambda_ngx_apis.conf)
- NGINX configuration of importing NJS codebases and map directives for Lambda integration: [`/etc/nginx/serverless/lambda_ngx_http.conf`](../common/lambda-core/lambda_ngx_http.conf)
- NGINX proxy configuration to be set before proxy_pass to invoke Lambda APIs: [`/etc/nginx/serverless/lambda_ngx_proxy.conf`](../common/lambda-core/lambda_ngx_proxy.conf)

### Examples
4 changes: 2 additions & 2 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
| Name | Required? | Allowed Values | Default | Description |
|----------------------------|-----------|-----------------|--------------------------------------|-----------------------------------------------|
| `LAMBDA_REGION` | Yes | | `${AWS_REGION}` | Lambda region whose servers you want to send the requests |
| `LAMBDA_SERVER_PROTO` | Yes | `http`, `https` | `https` | Protocol to used connect to Lambda server |
| `LAMBDA_SERVER_PROTO` | Yes | `http`, `https` | `https` | Protocol to connect to Lambda server |
| `LAMBDA_SERVER` | Yes | | `lambda.${AWS_REGION}.amazonaws.com` | Lambda host to connect to |
| `LAMBDA_SERVER_PORT` | Yes | | `443` | SSL/TLS port to connect to |
| `AWS_ACCESS_KEY_ID` | No | | `${AWS_ACCESS_KEY_ID}` | AWS access key associated with an IAM account |
Expand Down Expand Up @@ -119,7 +119,7 @@

```bash
curl --location 'http://localhost/2015-03-31/functions/foo/invocations' \
--header 'Content-Type: application/json' \
--header 'Content-Type: application/json' \
--data '{
"message": "This is a sample message"
}'
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.