diff --git a/Makefile b/Makefile index 91981d0..eda6e04 100644 --- a/Makefile +++ b/Makefile @@ -25,4 +25,18 @@ clean: ## Clean up any temporary files hot-reload: awslocal lambda update-function-code --function-name ScoringFunction --s3-bucket hot-reload --s3-key "$$(pwd)/lambdas/scoring" -.PHONY: usage deploy web save-state load-state clean +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: ## Stop LocalStack + @localstack stop + +ready: ## Wait until LocalStack is ready + @echo Waiting on the LocalStack container... + @localstack wait -t 30 && echo LocalStack is ready to use! || (echo Gave up waiting on LocalStack, exiting. && exit 1) + +logs: ## Save the logs in a separate file + @localstack logs > logs.txt + +.PHONY: usage deploy web save-state load-state clean start stop ready logs diff --git a/README.md b/README.md index 9f9969b..ea82dbf 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,8 @@ The following diagram shows the architecture that this sample application builds ## Prerequisites -- [`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) +- 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) - [AWS CDK](https://docs.localstack.cloud/user-guide/integrations/aws-cdk/) with [`cdklocal` wrapper](https://github.com/localstack/aws-cdk-local) (**optional**) - [Python 3.11+](https://www.python.org/downloads/) & `pip` for testing and Lambda functions