From a1c910f22f7086df22792bf5e6285b5ae5336f6a Mon Sep 17 00:00:00 2001 From: Harsh Mishra Date: Fri, 6 Mar 2026 00:54:12 +0530 Subject: [PATCH 1/2] Add Makefile and update README with auth token setup --- Makefile | 37 +++++++++++++++++++++++++++++++++++++ README.md | 17 +++++++++++++---- 2 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b378d23 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +export AWS_ACCESS_KEY_ID ?= test +export AWS_SECRET_ACCESS_KEY ?= test +export AWS_DEFAULT_REGION=us-east-1 +SHELL := /bin/bash + +usage: ## Show this help + @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' + +install: ## Install dependencies + @which localstack || pip install localstack + @which awslocal || pip install awscli-local + @which tflocal || pip install terraform-local + +start: ## Start LocalStack + @test -n "${LOCALSTACK_AUTH_TOKEN}" || (echo "LOCALSTACK_AUTH_TOKEN is not set. Find your token at https://app.localstack.cloud/workspace/auth-token"; exit 1) + @LOCALSTACK_AUTH_TOKEN=$(LOCALSTACK_AUTH_TOKEN) localstack start -d + +stop: ## Stop LocalStack + @localstack stop + +ready: ## Wait until LocalStack is ready + @echo Waiting on the LocalStack container... + @localstack wait -t 30 && echo LocalStack is ready to use! || (echo Gave up waiting on LocalStack, exiting. && exit 1) + +logs: ## Save the logs in a separate file + @localstack logs > logs.txt + +deploy: ## Deploy infrastructure using Terraform + tflocal init + tflocal plan + tflocal apply --auto-approve + +test: ## Run Terraform tests + tflocal init + tflocal test + +.PHONY: usage install start stop ready logs deploy test diff --git a/README.md b/README.md index 3ed4e0b..09ad4c6 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,19 @@ This is a simple example of how to use LocalStack to create a serverless image r ## Requirements -- LocalStack CLI -- Terraform CLI -- `tflocal` wrapper script -- `awslocal` wrapper script +- LocalStack Pro with the [`localstack` CLI](https://docs.localstack.cloud/getting-started/installation/#localstack-cli). +- [Terraform CLI](https://www.terraform.io/downloads) with the [`tflocal` wrapper](https://github.com/localstack/terraform-local). +- [AWS CLI](https://docs.localstack.cloud/user-guide/integrations/aws-cli/) with the [`awslocal` wrapper](https://docs.localstack.cloud/user-guide/integrations/aws-cli/#localstack-aws-cli-awslocal). + +## Start LocalStack + +Start LocalStack Pro with the `LOCALSTACK_AUTH_TOKEN` pre-configured: + +```bash +export LOCALSTACK_AUTH_TOKEN= +make start +make ready +``` ## Build the Lambda function From 331412f6ed80f1f52527424c32e0c544ffd8b469 Mon Sep 17 00:00:00 2001 From: Harsh Mishra Date: Fri, 6 Mar 2026 01:19:10 +0530 Subject: [PATCH 2/2] Fix README: remove LocalStack Pro, add license bullet --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 09ad4c6..02c65fa 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,10 @@ This is a simple example of how to use LocalStack to create a serverless image r ## Requirements -- LocalStack Pro with the [`localstack` CLI](https://docs.localstack.cloud/getting-started/installation/#localstack-cli). +- LocalStack with the [`localstack` CLI](https://docs.localstack.cloud/getting-started/installation/#localstack-cli). - [Terraform CLI](https://www.terraform.io/downloads) with the [`tflocal` wrapper](https://github.com/localstack/terraform-local). - [AWS CLI](https://docs.localstack.cloud/user-guide/integrations/aws-cli/) with the [`awslocal` wrapper](https://docs.localstack.cloud/user-guide/integrations/aws-cli/#localstack-aws-cli-awslocal). +- A valid [LocalStack for AWS license](https://localstack.cloud/pricing). Your license provides a [`LOCALSTACK_AUTH_TOKEN`](https://docs.localstack.cloud/getting-started/auth-token/) to activate LocalStack. ## Start LocalStack