Skip to content

Commit 7e522e1

Browse files
committed
chore: change lambda core & emulator path
1 parent a9978ca commit 7e522e1

26 files changed

+44
-17
lines changed

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,26 @@
22

33
## Introduction
44

5-
This project provides a working configuration of NGINX configured to act as an authenticating gateway for to AWS Lambda service. This allows you to proxy a private Lambda function without requiring users to authenticate to it. Within the proxy layer, additional functionality can be configured such as:
5+
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. Within the proxy layer, additional functionality can be configured such as:
66

77
- Providing an authentication gateway using an alternative authentication
88
system to Lambda functions
99
- For internal/micro services that can't authenticate against the Lambda functions
1010
(e.g. don't have libraries available) the gateway can provide a means
1111
to accessing Lambda functions without authentication
12-
- Protecting Lambda function from arbitrary public access and traversal
13-
- Rate limiting Lambda functions
12+
- Protecting Lambda functions from arbitrary public access and traversal
13+
- [Rate limiting](http://nginx.org/en/docs/http/ngx_http_limit_req_module.html) Lambda functions
1414
- Protecting Lambda functions with a [WAF](https://docs.nginx.com/nginx-waf/)
1515

16-
1716
## Getting Started
1817

1918
Refer to the [Getting Started Guide](docs/getting_started.md) for how to build and run the gateway.
2019

2120
## Directory Structure and File Descriptions
2221

23-
2422
## Development
2523

26-
Refer to the [Development Guide](docs/development.md) for more information about
27-
extending or testing the gateway.
24+
Refer to the [Development Guide](docs/development.md) for more information about extending or testing the gateway.
2825

2926
## License
3027

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
include "aws/lambda_ngx_http.conf";
2+
3+
# Add the endpoint & host of Lambda server when using AWS Lambda Function URL.
4+
# Add the endpoint, and assign the value of $lambdaFunctionARNHost when using
5+
# AWS Lambda Function ARN.
6+
map $request_uri $lambda_host {
7+
# Default host name is used for AWS Lambda Function ARN
8+
default $lambdaFunctionARNHost;
9+
}
10+
11+
# Add the endpoint when using AWS Lambda Function URL. The default value is for
12+
# the URL of AWS Lambda Function ARN.
13+
map $request_uri $lambda_url {
14+
default $lambdaProto://$lambda_host:$lambdaPort;
15+
}
16+
17+
server {
18+
include "aws/lambda_ngx_apis.conf";
19+
listen 80; # Use SSL/TLS in production
20+
21+
# Example of a proxy to all of the AWS Lambda Function ARNs.
22+
location / {
23+
auth_request /aws/credentials/retrieval;
24+
js_content lambdagateway.redirectToLambdaFunctionARN;
25+
}
26+
27+
# Enable when debugging is needed
28+
error_log /var/log/nginx/error.log debug; # Reduce severity level as required
29+
access_log /var/log/nginx/access.log main;
30+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ services:
1212
# Enable this when using NGINX Plus
1313
# dockerfile: docker/Dockerfile.plus
1414
volumes:
15-
- ./examples/01-all-lambda-function-arns:/etc/nginx/conf.d/
16-
- ./core:/etc/nginx/aws
15+
- ./common/etc/nginx/conf.d:/etc/nginx/conf.d
16+
- ./common/lambda-core:/etc/nginx/aws
1717
ports:
1818
- "80:80"
1919
env_file:

docker/Dockerfile.oss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ RUN chmod -R 644 /etc/nginx
99
RUN chmod -R 644 /etc/nginx/aws
1010
RUN chmod -R 644 /etc/nginx/conf.d
1111

12-
COPY core/* /etc/nginx/aws/
13-
COPY common/nginx/nginx.conf /etc/nginx/
12+
COPY common/lambda-core/* /etc/nginx/aws/
13+
COPY common/etc/nginx/nginx.conf /etc/nginx/
1414

1515
STOPSIGNAL SIGTERM
1616
CMD ["nginx", "-g", "daemon off;"]

docker/Dockerfile.plus

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ RUN chmod -R 644 /etc/nginx
8585
RUN chmod -R 644 /etc/nginx/aws
8686
RUN chmod -R 644 /etc/nginx/conf.d
8787

88-
COPY core/* /etc/nginx/aws/
89-
COPY common/nginx/nginx.conf /etc/nginx/
88+
COPY common/lambda-core/* /etc/nginx/aws/
89+
COPY common/etc/nginx/nginx.conf /etc/nginx/
9090

9191
STOPSIGNAL SIGQUIT
9292

examples/01-all-lambda-function-arns/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
# dockerfile: ./docker/Dockerfile.plus
1414
volumes:
1515
- ../../examples/01-all-lambda-function-arns/:/etc/nginx/conf.d/
16-
- ../../core:/etc/nginx/aws
16+
- ../../common/lambda-core:/etc/nginx/aws
1717
ports:
1818
- "80:80"
1919
env_file:

examples/02-one-lambda-function-arn/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
# dockerfile: ./docker/Dockerfile.plus
1414
volumes:
1515
- ../../examples/02-one-lambda-function-arn/:/etc/nginx/conf.d/
16-
- ../../core:/etc/nginx/aws
16+
- ../../common/lambda-core:/etc/nginx/aws
1717
ports:
1818
- "80:80"
1919
env_file:

examples/03-one-lambda-function-url/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
# dockerfile: ./docker/Dockerfile.plus
1414
volumes:
1515
- ../../examples/03-one-lambda-function-url/:/etc/nginx/conf.d/
16-
- ../../core:/etc/nginx/aws
16+
- ../../common/lambda-core:/etc/nginx/aws
1717
ports:
1818
- "80:80"
1919
env_file:

examples/04-lambda-function-arn-and-url/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
# dockerfile: ./docker/Dockerfile.plus
1414
volumes:
1515
- ../../examples/04-lambda-function-arn-and-url/:/etc/nginx/conf.d/
16-
- ../../core:/etc/nginx/aws
16+
- ../../common/lambda-core:/etc/nginx/aws
1717
ports:
1818
- "80:80"
1919
env_file:

0 commit comments

Comments
 (0)