From f875bbd705e389883c662322ce57db2ba140671b Mon Sep 17 00:00:00 2001 From: Harsh Mishra Date: Tue, 10 Mar 2026 23:22:55 +0530 Subject: [PATCH] fix: add LocalStack license requirement and update setup docs - Add standard start/stop/ready/logs targets with auth guard to Makefile - Add license bullet to Prerequisites in README - Update start section with make start/make ready --- Makefile | 21 ++++++++++++++++++++- README.md | 7 +++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 1a6c40e..07577d3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,9 @@ -.PHONY: deploy-localstack deploy-aws +export AWS_ACCESS_KEY_ID ?= test +export AWS_SECRET_ACCESS_KEY ?= test +export AWS_DEFAULT_REGION=us-east-1 +SHELL := /bin/bash + +.PHONY: deploy-localstack deploy-aws start stop ready logs list-resources-localstack: @echo "List resources" @@ -7,6 +12,20 @@ list-resources-localstack: awslocal firehose list-delivery-streams awslocal redshift describe-clusters +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 + start-localstack: @docker ps -f "name=localstack" | grep localstack > /dev/null || (echo "Starting localstack..." && localstack start) diff --git a/README.md b/README.md index 869bff4..d7366ce 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,13 @@ LocalStack sample CDK app deploying cross-region and cross-account EventBridge b # Prerequisites ## Required Software +- 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. - Python 3.11 - node >16 - Docker - AWS CLI - AWS CDK -- LocalStack CLI +- [`localstack` CLI](https://docs.localstack.cloud/getting-started/installation/#localstack-cli)
if you are on Mac: @@ -113,7 +114,9 @@ Against LocalStack - You need to bootstrap for the desired region and account each time you start LocalStack ```bash -localstack start +export LOCALSTACK_AUTH_TOKEN= +make start +make ready cdklocal synth cdklocal bootstrap aws://000000000000/us-east-1 cdklocal bootstrap aws://000000000000/eu-central-1