From d4c1456e1dc736993b66e2a0ab94e5d34b55690d Mon Sep 17 00:00:00 2001 From: Baptiste Bouchereau Date: Mon, 24 Feb 2020 19:28:01 +0100 Subject: [PATCH] Use docker-compose to run commands --- localstack-part-3/README.md | 9 ++++----- .../docker-events-listener-build/listen-docker-events.sh | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/localstack-part-3/README.md b/localstack-part-3/README.md index 65ef580..9f3db60 100644 --- a/localstack-part-3/README.md +++ b/localstack-part-3/README.md @@ -10,7 +10,6 @@ Usage Run - ```bash git clone https://github.com/Ovski4/tutorials.git cd localstack-part-3 @@ -22,9 +21,9 @@ docker-compose logs -f docker-events-listener Wait for the resources to be deployed, then invoke the lambda multiple times and scan the table to see new items and their counters being incremented: ```bash -aws lambda invoke --function-name counter --endpoint-url=http://localhost:4574 --payload '{"id": "test"}' output.txt -aws dynamodb scan --endpoint-url http://localhost:4569 --table-name table_1 +docker-compose exec docker-events-listener aws lambda invoke --function-name counter --endpoint-url=http://localstack:4574 --payload '{"id": "test"}' output.txt +docker-compose exec docker-events-listener aws dynamodb scan --endpoint-url http://localstack:4569 --table-name table_1 -aws lambda invoke --function-name counter --endpoint-url=http://localhost:4574 --payload '{"id": "test2"}' output.txt -aws dynamodb scan --endpoint-url http://localhost:4569 --table-name table_1 +docker-compose exec docker-events-listener aws lambda invoke --function-name counter --endpoint-url=http://localstack:4574 --payload '{"id": "test2"}' output.txt +docker-compose exec docker-events-listener aws dynamodb scan --endpoint-url http://localstack:4569 --table-name table_1 ``` \ No newline at end of file diff --git a/localstack-part-3/docker-events-listener-build/listen-docker-events.sh b/localstack-part-3/docker-events-listener-build/listen-docker-events.sh index 3ea1e13..9cfd7ab 100644 --- a/localstack-part-3/docker-events-listener-build/listen-docker-events.sh +++ b/localstack-part-3/docker-events-listener-build/listen-docker-events.sh @@ -10,6 +10,7 @@ do echo "$container_name: status = ${event}" if [[ $APPLY_TERRAFORM_ON_START == "true" ]] && [[ $container_name = "localstack" ]] && [[ $event == "start" ]]; then + sleep 20 # let localstack some time to start terraform init terraform apply --auto-approve echo "The terraform configuration has been applied."