From b3a5e46db74af338ea80cee7ce414c9a2c01abfc Mon Sep 17 00:00:00 2001 From: Jordan Brough Date: Mon, 16 Jan 2023 06:47:56 -0700 Subject: [PATCH 1/8] Add missing backslash in docker command --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4782a65..82cc6c6 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ You install the runtime interface emulator to your local machine. When you run t 2. Run your Lambda image function using the docker run command. ``` - docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 myfunction:latest + docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 myfunction:latest \ --entrypoint /aws-lambda/aws-lambda-rie <(optional) image command>` ``` From 25da312c28c9265f3307f7eeeac562d71e5d9694 Mon Sep 17 00:00:00 2001 From: Jordan Brough Date: Mon, 16 Jan 2023 06:48:37 -0700 Subject: [PATCH 2/8] Remove stray "`" from command --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 82cc6c6..a7cefa3 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ You install the runtime interface emulator to your local machine. When you run t ``` docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 myfunction:latest \ - --entrypoint /aws-lambda/aws-lambda-rie <(optional) image command>` + --entrypoint /aws-lambda/aws-lambda-rie <(optional) image command> ``` This runs the image as a container and starts up an endpoint locally at `localhost:9000/2015-03-31/functions/function/invocations`. From 934c0b635f245fd73b5db69a1119237c7ffa3d0d Mon Sep 17 00:00:00 2001 From: Jordan Brough Date: Mon, 16 Jan 2023 06:49:08 -0700 Subject: [PATCH 3/8] Covert code snippet to code block for consistency --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a7cefa3..758aefa 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,9 @@ You install the runtime interface emulator to your local machine. When you run t 3. Post an event to the following endpoint using a curl command: - `curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'` + ``` + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' + ``` This command invokes the function running in the container image and returns a response. From b8f3d67d53b1e504703dd1eabe0ba78dcfb04796 Mon Sep 17 00:00:00 2001 From: Jordan Brough Date: Mon, 16 Jan 2023 06:51:37 -0700 Subject: [PATCH 4/8] Remove extraneous newline This doesn't show up in markdown --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 758aefa..82a7844 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,6 @@ it to test extensions and agents built into the container image against the Lamb does *not *emulate* *the orchestration behavior of AWS Lambda. For example, Lambda has a network and security configurations that will not be emulated by this component. - * You can use the emulator to test if your function code is compatible with the Lambda environment, runs successfully and provides the expected output. * You can also use it to test extensions and agents built into the container image against the Lambda Extensions API. * This component does _not_ emulate Lambda’s orchestration, or security and authentication configurations. From f5d48d5171648132f794c1c66245bb585b0fdc1b Mon Sep 17 00:00:00 2001 From: Jordan Brough Date: Mon, 16 Jan 2023 06:53:05 -0700 Subject: [PATCH 5/8] Fix invalid italics and use "_" for consistency See similar item just below. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 82a7844..b89c799 100644 --- a/README.md +++ b/README.md @@ -175,7 +175,7 @@ The rest of these Environment Variables can be set to match AWS Lambda's environ You can use the emulator to test if your function code is compatible with the Lambda environment, executes successfully and provides the expected output. For example, you can mock test events from different event sources. You can also use it to test extensions and agents built into the container image against the Lambda Extensions API. This component -does *not *emulate* *the orchestration behavior of AWS Lambda. For example, Lambda has a network and security +does _not_ emulate the orchestration behavior of AWS Lambda. For example, Lambda has a network and security configurations that will not be emulated by this component. * You can use the emulator to test if your function code is compatible with the Lambda environment, runs successfully and provides the expected output. From 290cc3cc77f5a03f2c38b214c8e3f992bd0cdabd Mon Sep 17 00:00:00 2001 From: Jordan Brough Date: Mon, 16 Jan 2023 06:58:24 -0700 Subject: [PATCH 6/8] Change (invalid) italics to header Make it consistent with the preceding section that says: "To build the emulator into your image" Also, the stray whitespace before the final asterisk was incorrect. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b89c799..f4541d2 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,8 @@ You can build RIE into a base image. Download the RIE from GitHub to your local ### Test an image without adding RIE to the image You install the runtime interface emulator to your local machine. When you run the container image, you set the entry point to be the emulator. -*To test an image without adding RIE to the image * + +#### To test an image without adding RIE to the image 1. From your project directory, run the following command to download the RIE (x86-64 architecture) from GitHub and install it on your local machine. From 6cda1bf61d9ea33b076bcad399d079db6c2da32f Mon Sep 17 00:00:00 2001 From: Jordan Brough Date: Mon, 16 Jan 2023 07:00:31 -0700 Subject: [PATCH 7/8] Add syntax highlighting to code blocks --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f4541d2..8deb090 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ You can build RIE into a base image. Download the RIE from GitHub to your local The following example shows a typical script for a Node.js function. - ``` + ```sh #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric @@ -94,27 +94,27 @@ You can build RIE into a base image. Download the RIE from GitHub to your local To use the default x86\_64 architecture - ``` + ```dockerfile ADD aws-lambda-rie /usr/local/bin/aws-lambda-rie ENTRYPOINT [ "/entry_script.sh" ] ``` To use the arm64 architecture: - ``` + ```dockerfile ADD aws-lambda-rie-arm64 /usr/local/bin/aws-lambda-rie ENTRYPOINT [ "/entry_script.sh" ] ``` 4. Build your image locally using the docker build command. - ``` + ```sh docker build -t myfunction:latest . ``` 5. Run your image locally using the docker run command. - ``` + ```sh docker run -p 9000:8080 myfunction:latest ``` @@ -126,7 +126,7 @@ You install the runtime interface emulator to your local machine. When you run t 1. From your project directory, run the following command to download the RIE (x86-64 architecture) from GitHub and install it on your local machine. - ``` + ```sh mkdir -p ~/.aws-lambda-rie && curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \ https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \ && chmod +x ~/.aws-lambda-rie/aws-lambda-rie @@ -140,7 +140,7 @@ You install the runtime interface emulator to your local machine. When you run t 2. Run your Lambda image function using the docker run command. - ``` + ```sh docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 myfunction:latest \ --entrypoint /aws-lambda/aws-lambda-rie <(optional) image command> ``` @@ -149,7 +149,7 @@ You install the runtime interface emulator to your local machine. When you run t 3. Post an event to the following endpoint using a curl command: - ``` + ```sh curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` From 6b1320cae86dcc92135437d06d91cd5232f5662e Mon Sep 17 00:00:00 2001 From: Jordan Brough Date: Mon, 16 Jan 2023 09:14:56 -0700 Subject: [PATCH 8/8] Add header to content table --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8deb090..3599cc0 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Lambda’s orchestrator, or security and authentication configurations. You can * [Build RIE into your base image](#build-rie-into-your-base-image) * [To build the emulator into your image](#to-build-the-emulator-into-your-image) * [Test an image without adding RIE to the image](#test-an-image-without-adding-rie-to-the-image) + * [To test an image without adding RIE to the image](#to-test-an-image-without-adding-rie-to-the-image) * [How to configure](#how-to-configure) * [Level of support](#level-of-support) * [Security](#security)