Skip to content

Commit 5b74e3a

Browse files
authored
fix: update LocalStack license requirement and standardize CI workflow (#5)
- Add auth guard to Makefile start target - Add license bullet and update start section in README - Upgrade checkout@v3->v4, upload-artifact@v3->v4 in CI workflow - Replace deprecated LOCALSTACK_API_KEY with LOCALSTACK_AUTH_TOKEN
1 parent c2639bc commit 5b74e3a

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424

2525
- name: Setup Python
2626
uses: actions/setup-python@v4
@@ -39,14 +39,14 @@ jobs:
3939
4040
- name: Start LocalStack
4141
env:
42-
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
42+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
4343
DNS_ADDRESS: 0
4444
run: |
4545
pip install localstack awscli-local[ver1]
4646
pip install terraform-local
4747
docker pull localstack/localstack-pro:latest
4848
# Start LocalStack in the background
49-
DEBUG=1 localstack start -d
49+
DEBUG=1 LOCALSTACK_AUTH_TOKEN=$LOCALSTACK_AUTH_TOKEN localstack start -d
5050
# Wait 30 seconds for the LocalStack container to become ready before timing out
5151
echo "Waiting for LocalStack startup..."
5252
localstack wait -t 15
@@ -86,7 +86,7 @@ jobs:
8686
8787
- name: Upload the Diagnostic Report
8888
if: failure()
89-
uses: actions/upload-artifact@v3
89+
uses: actions/upload-artifact@v4
9090
with:
9191
name: diagnose.json.gz
9292
path: ./diagnose.json.gz

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ deploy:
2323

2424
## Start LocalStack in detached mode
2525
start:
26-
localstack start -d
26+
@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)
27+
@LOCALSTACK_AUTH_TOKEN=$(LOCALSTACK_AUTH_TOKEN) DEBUG=1 localstack start -d
2728

2829
## Stop the Running LocalStack container
2930
stop:

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,23 @@ We are using the following AWS services and their features to build our infrastr
3535

3636
## Prerequisites
3737

38-
- LocalStack Pro with the [`localstack` CLI](https://docs.localstack.cloud/getting-started/installation/#localstack-cli).
38+
- 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.
39+
- [`localstack` CLI](https://docs.localstack.cloud/getting-started/installation/#localstack-cli).
3940
- [Serverless Application Model](https://docs.localstack.cloud/user-guide/integrations/aws-sam/) with the [`samlocal`](https://github.com/localstack/aws-sam-cli-local) installed.
4041
- [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).
4142
- [Python 3.9.0](https://www.python.org/downloads/release/python-390/) in the `PATH`
4243

43-
Start LocalStack Pro with the `LOCALSTACK_AUTH_TOKEN` pre-configured:
44+
## Start LocalStack
45+
46+
Start LocalStack with the `LOCALSTACK_AUTH_TOKEN` pre-configured:
4447

4548
```shell
4649
export LOCALSTACK_AUTH_TOKEN=<your-auth-token>
47-
DEBUG=1 localstack start
50+
make start
51+
make ready
4852
```
4953

50-
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.
54+
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.
5155

5256
## Instructions
5357

0 commit comments

Comments
 (0)