Skip to content

Commit cf92d4a

Browse files
authored
Pin awslocal command output to JSON (#62)
1 parent a9646d2 commit cf92d4a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ deploy: ## Deploy the app
1616
SLS_DEBUG=1 serverless deploy --stage local
1717

1818
send-request: ## Send a test request to the deployed application
19+
@which jq || (echo "jq was not found. Please install it (https://jqlang.github.io/jq/download/) and try again." && exit 1)
1920
@echo Looking up API ID from deployed API Gateway REST APIs ...; \
20-
apiId=$$(awslocal apigateway get-rest-apis | jq -r '.items[] | select(.name="local-localstack-demo") | .id'); \
21+
apiId=$$(awslocal apigateway get-rest-apis --output json | jq -r '.items[] | select(.name="local-localstack-demo") | .id'); \
2122
echo Sending request to API Gateway REST APIs ID "$$apiId" ...; \
2223
requestID=$$(curl -s -d '{}' http://$$apiId.execute-api.localhost.localstack.cloud:4566/local/requests | jq -r .requestID); \
2324
echo "Received request ID '$$requestID'"; \

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The sample app illustrates a typical Web application scenario with asynchronous
1414
* Docker
1515
* Node.js / `yarn`
1616
* `make`
17+
* (optional) jq
1718

1819
Note: Please make sure to pull and start the `latest` LocalStack Docker image. At the time of writing (2023-02-01), the demo requires some features that were only recently added to LocalStack and are not part of a tagged release version yet.
1920

0 commit comments

Comments
 (0)