diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0b26a99..e3b88a7 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: 16 + node-version: 22 - name: Setup SAM uses: aws-actions/setup-sam@v2 @@ -59,12 +59,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 - LS_LOG=trace localstack start -d + LS_LOG=trace 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 @@ -99,7 +99,7 @@ jobs: - name: Upload the Diagnostic Report if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: diagnose.json.gz path: ./diagnose.json.gz diff --git a/Makefile b/Makefile index d73b83b..939969d 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 a3cda70..0cfa922 100644 --- a/README.md +++ b/README.md @@ -32,22 +32,24 @@ We are using the following AWS services to build our infrastructure: ## 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). * [Serverless Application Model](https://docs.localstack.cloud/user-guide/integrations/aws-sam/) with the [samlocal](https://github.com/localstack/aws-sam-cli-local) installed. * [Python 3.9 installed](https://www.python.org/downloads/). * [Node.js](https://nodejs.org/en/download) with npm package manager. * [Artillery](https://artillery.io/docs/guides/overview/welcome.html) to generate some load towards both the apis. -* [`yq`](https://github.com/mikefarah/yq#install) and[`jq`](https://jqlang.github.io/jq/download/) for running the deployment script. +* [`yq`](https://github.com/mikefarah/yq#install) and [`jq`](https://jqlang.github.io/jq/download/) for running the deployment script. -Start LocalStack Pro with the `LOCALSTACK_AUTH_TOKEN` pre-configured: +## Start LocalStack + +Start LocalStack with the `LOCALSTACK_AUTH_TOKEN` pre-configured: ```shell 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 deploy` to create the infrastructure on LocalStack. Run `make stop` to delete the infrastructure by stopping LocalStack.