From 178ea9960dfa51d0064a60e16ad330407d7ca2f1 Mon Sep 17 00:00:00 2001 From: Harsh Mishra Date: Tue, 10 Mar 2026 23:11:39 +0530 Subject: [PATCH] fix: update LocalStack license requirement and standardize CI workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add auth guard to Makefile start target - Add license bullet and update start section in README - Upgrade checkout@v3→v4, setup-node@v3→v4, Node 18→22 in CI workflow - Replace LOCALSTACK_API_KEY with LOCALSTACK_AUTH_TOKEN --- .github/workflows/main.yml | 10 +++++----- Makefile | 5 +++-- README.md | 12 +++++++----- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d318b05..4792b34 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v4 @@ -28,9 +28,9 @@ jobs: python-version: '3.9' - name: Setup Nodejs - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 22 - name: Install dependencies run: | @@ -38,12 +38,12 @@ jobs: - name: Start LocalStack env: - LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }} + LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }} DNS_ADDRESS: 0 run: | docker pull localstack/localstack-pro:latest # Start LocalStack in the background - DEBUG=1 localstack start -d + DEBUG=1 LOCALSTACK_AUTH_TOKEN=$LOCALSTACK_AUTH_TOKEN localstack start -d # Wait 30 seconds for the LocalStack container to become ready before timing out echo "Waiting for LocalStack startup..." localstack wait -t 15 diff --git a/Makefile b/Makefile index 7d11e77..db0d158 100644 --- a/Makefile +++ b/Makefile @@ -16,8 +16,9 @@ install: ## Install dependencies run: ## Deploy the app locally and run an AppSync GraphQL test invocation ./run.sh -start: - localstack start -d +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: @echo diff --git a/README.md b/README.md index 92e8e5d..5accc10 100644 --- a/README.md +++ b/README.md @@ -27,21 +27,23 @@ We are using the following AWS services and third-party integrations to build ou ## 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). - [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). - [Python](https://www.python.org/downloads/) - [`cURL`](https://curl.se/) - [`wscat`](https://github.com/websockets/wscat) -Start LocalStack Pro with the `LOCALSTACK_AUTH_TOKEN` pre-configured: +## Start LocalStack + +Start LocalStack with the `LOCALSTACK_AUTH_TOKEN` pre-configured: ```sh export LOCALSTACK_AUTH_TOKEN= -localstack start +make start +make ready ``` -> 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. - ## Instructions You can build and deploy the sample application on LocalStack by running our `Makefile` commands. Run `make install` to install the dependencies and `make run` to create the infrastructure on LocalStack. Run `make stop` to delete the infrastructure by stopping LocalStack.