From de67b783a389cac11af99c63abd8522dd2e2969c Mon Sep 17 00:00:00 2001 From: HarshCasper Date: Fri, 17 May 2024 21:17:05 +0530 Subject: [PATCH] add some basic docs --- lambda-layers/terraform/Makefile | 2 +- lambda-layers/terraform/README.md | 49 +++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 lambda-layers/terraform/README.md diff --git a/lambda-layers/terraform/Makefile b/lambda-layers/terraform/Makefile index cd5a17f..7494a8f 100644 --- a/lambda-layers/terraform/Makefile +++ b/lambda-layers/terraform/Makefile @@ -42,7 +42,7 @@ invoke: output.json cat output.json -run: start install init deploy invoke +run: start install package init deploy invoke clean: rm -rf build diff --git a/lambda-layers/terraform/README.md b/lambda-layers/terraform/README.md new file mode 100644 index 0000000..c22c621 --- /dev/null +++ b/lambda-layers/terraform/README.md @@ -0,0 +1,49 @@ +# Lambda Layers with Terraform + +Simple demo application illustrating Lambda layers using LocalStack, deployed via Terraform. + +## Prerequisites + +* LocalStack +* Docker +* Terraform & `tflocal` +* Python & `pip` +* `make` + +## Installing + +To install the dependencies: +``` +make install +``` + +## Running + +Make sure that LocalStack is started: + +``` +LOCALSTACK_AUTH_TOKEN=... DEBUG=1 localstack start +``` + +Deploy the app locally and run a Lambda test invocation: + +``` +make run +``` + +You should see a success output in the terminal: +``` +{"status": "success"} +``` + +... and your LocalStack container should contain output similar to this: + +``` +2024-05-17T15:46:22.870 DEBUG --- [et.reactor-1] l.s.l.i.version_manager : [my-lambda-function-52785b61-d14d-4871-8074-d5ab5fc49bb1] REPORT RequestId: 52785b61-d14d-4871-8074-d5ab5fc49bb1 Duration: 20.65 ms Billed Duration: 21 ms Memory Size: 128 MBMax Memory Used: 128 MB +2024-05-17T15:46:22.872 DEBUG --- [et.reactor-1] l.s.lambda_.provider : Lambda invocation duration: 2230.03ms +2024-05-17T15:46:22.874 INFO --- [et.reactor-1] localstack.request.aws : AWS lambda.Invoke => 200 +``` + +## License + +This code is available under the Apache 2.0 license.