Use docker-compose to run commands
rodzic
926b4e05fe
commit
d4c1456e1d
|
@ -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
|
||||
```
|
|
@ -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."
|
||||
|
|
Ładowanie…
Reference in New Issue