From 65e32904b3b14050dd0d1ceafd83fe99c3039525 Mon Sep 17 00:00:00 2001 From: Harsh Mishra Date: Fri, 6 Mar 2026 01:49:12 +0530 Subject: [PATCH] Add LocalStack auth token requirement and standardize setup - Add license requirement bullet to Prerequisites - Add auth guard to start target in Makefile - Add Start LocalStack section to README - Upgrade actions/checkout and setup-node to v4 - Add LOCALSTACK_AUTH_TOKEN to main.yml workflow - Replace LOCALSTACK_API_KEY with LOCALSTACK_AUTH_TOKEN in pods.yml --- .github/workflows/main.yml | 5 +++-- .github/workflows/pods.yml | 4 ++-- Makefile | 3 ++- README.md | 11 ++++++++--- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3effc28..cd5b1ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,10 +20,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20 @@ -38,6 +38,7 @@ jobs: - name: Start LocalStack env: + LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }} DNS_ADDRESS: 0 run: | pip install localstack awscli-local[ver1] diff --git a/.github/workflows/pods.yml b/.github/workflows/pods.yml index 6f30f81..4cd27bc 100644 --- a/.github/workflows/pods.yml +++ b/.github/workflows/pods.yml @@ -27,7 +27,7 @@ jobs: image-tag: 'latest' use-pro: 'true' env: - LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }} + LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }} - name: Load the Cloud Pod uses: LocalStack/setup-localstack/cloud-pods@main @@ -35,7 +35,7 @@ jobs: name: loan-broker-infra action: load env: - LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }} + LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }} - name: Run integration tests run: | diff --git a/Makefile b/Makefile index b638cad..6d967a3 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,8 @@ deploy: ## Start LocalStack in detached mode start: - localstack start -d + @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 the Running LocalStack container stop: diff --git a/README.md b/README.md index 60355a0..208c4d9 100644 --- a/README.md +++ b/README.md @@ -34,15 +34,20 @@ The following diagram shows the architecture that this sample application builds ## Prerequisites -- LocalStack Pro with the [`localstack` CLI](https://docs.localstack.cloud/getting-started/installation/#localstack-cli). +- 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. +- [`localstack` CLI](https://docs.localstack.cloud/getting-started/installation/#localstack-cli). - [Cloud Development Kit](https://docs.localstack.cloud/user-guide/integrations/aws-cdk/) with the [`cdklocal`](https://www.npmjs.com/package/aws-cdk-local) installed. - [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). - [Node.js](https://nodejs.org/en/download), and [`yarn`](https://yarnpkg.com/). -Start LocalStack Community edition: +## Start LocalStack + +Start LocalStack with the `LOCALSTACK_AUTH_TOKEN` pre-configured: ```shell -DEBUG=1 localstack start +export LOCALSTACK_AUTH_TOKEN= +make start +make ready ``` We specified DEBUG=1 to get the printed LocalStack logs directly in the terminal to help us see the event-driven architecture in action. If you prefer running LocalStack in detached mode, you can add the `-d` flag to the `localstack start` command, and use Docker Desktop to view the logs.