Skip to content

Commit 04ea97b

Browse files
authored
Add LocalStack license requirement and standardize setup
Add LocalStack license requirement and standardize setup
1 parent 7742a3b commit 04ea97b

3 files changed

Lines changed: 24 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ 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 Node.js
26-
uses: actions/setup-node@v3
26+
uses: actions/setup-node@v4
2727
with:
2828
node-version: 20
2929

Makefile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,19 @@ $(VENV_ACTIVATE):
3131

3232
venv: $(VENV_ACTIVATE) ## Create a new (empty) virtual environment
3333

34-
start:
35-
$(LOCAL_ENV) docker compose up --build --detach --wait
34+
start: ## Start LocalStack
35+
@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)
36+
$(LOCAL_ENV) LOCALSTACK_AUTH_TOKEN=$(LOCALSTACK_AUTH_TOKEN) docker compose up --build --detach --wait
37+
38+
stop: ## Stop LocalStack
39+
docker compose down
40+
41+
ready: ## Wait until LocalStack is ready
42+
@echo Waiting on the LocalStack container...
43+
@localstack wait -t 30 && echo LocalStack is ready to use! || (echo Gave up waiting on LocalStack, exiting. && exit 1)
44+
45+
logs: ## Save the logs in a separate file
46+
@localstack logs > logs.txt
3647

3748
install: venv
3849
$(VENV_RUN); $(PIP_CMD) install -r requirements.txt
@@ -56,3 +67,5 @@ run:
5667

5768
run-aws:
5869
$(VENV_RUN); $(CLOUD_ENV) python run.py
70+
71+
.PHONY: usage venv start stop ready logs install deploy deploy-aws destroy destroy-aws run run-aws

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@ This scenario demonstrates how to use Database Migration Service (DMS) to create
88

99
## Pre-requisites
1010

11-
- [LocalStack Auth Token](https://docs.localstack.cloud/getting-started/auth-token/)
11+
- 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.
1212
- [Python 3.10](https://www.python.org/downloads/) & `pip`
1313
- [Docker Compose](https://docs.docker.com/compose/install/)
1414
- [CDK](https://docs.localstack.cloud/user-guide/integrations/aws-cdk/) with the [`cdklocal`](https://github.com/localstack/aws-cdk-local) wrapper.
1515

16-
17-
Start LocalStack Pro with the `LOCALSTACK_AUTH_TOKEN` pre-configured:
16+
## Start LocalStack
17+
18+
Start LocalStack with the `LOCALSTACK_AUTH_TOKEN` pre-configured:
1819

1920
```bash
2021
export LOCALSTACK_AUTH_TOKEN=<your-auth-token>
21-
docker-compose up
22+
make start
23+
make ready
2224
```
2325

24-
The Docker Compose file will start LocalStack Pro container and a Postgres container. The Postgres container will be used to showcase how to reach a database external to LocalStack.
26+
The Docker Compose file will start LocalStack container and a Postgres container. The Postgres container will be used to showcase how to reach a database external to LocalStack.
2527

2628
## Instructions
2729

0 commit comments

Comments
 (0)