Skip to content

Commit f126108

Browse files
authored
Add LocalStack for AWS license requirement (#36)
* Add LocalStack for AWS license requirement to prerequisites * Hyperlink LOCALSTACK_AUTH_TOKEN and clean up localstack CLI prerequisite * Add auth token guard to start target
1 parent 260e2e5 commit f126108

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

Makefile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,18 @@ clean: ## Clean up any temporary files
2525
hot-reload:
2626
awslocal lambda update-function-code --function-name ScoringFunction --s3-bucket hot-reload --s3-key "$$(pwd)/lambdas/scoring"
2727

28-
.PHONY: usage deploy web save-state load-state clean
28+
start: ## Start LocalStack
29+
@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)
30+
@LOCALSTACK_AUTH_TOKEN=$(LOCALSTACK_AUTH_TOKEN) localstack start -d
31+
32+
stop: ## Stop LocalStack
33+
@localstack stop
34+
35+
ready: ## Wait until LocalStack is ready
36+
@echo Waiting on the LocalStack container...
37+
@localstack wait -t 30 && echo LocalStack is ready to use! || (echo Gave up waiting on LocalStack, exiting. && exit 1)
38+
39+
logs: ## Save the logs in a separate file
40+
@localstack logs > logs.txt
41+
42+
.PHONY: usage deploy web save-state load-state clean start stop ready logs

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ The following diagram shows the architecture that this sample application builds
3535

3636
## Prerequisites
3737

38-
- [`localstack` CLI](https://docs.localstack.cloud/getting-started/installation/#localstack-cli) with a [`LOCALSTACK_AUTH_TOKEN`](https://docs.localstack.cloud/getting-started/auth-token/) (required for Pro features)
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
- [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)
4041
- [AWS CDK](https://docs.localstack.cloud/user-guide/integrations/aws-cdk/) with [`cdklocal` wrapper](https://github.com/localstack/aws-cdk-local) (**optional**)
4142
- [Python 3.11+](https://www.python.org/downloads/) & `pip` for testing and Lambda functions

0 commit comments

Comments
 (0)