Last active
October 25, 2023 10:52
-
-
Save zviryatko/395f29642bd2d29174c2b9954b8c89ae to your computer and use it in GitHub Desktop.
Invoke aws lambda with http request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Payload example: | |
# '{"httpMethod": "GET", "path": "/foo/bar"}' | |
FUNCTION_NAME=$1 | |
PAYLOAD=$2 | |
aws lambda invoke --function-name ${FUNCTION_NAME} --invocation-type RequestResponse --cli-binary-format raw-in-base64-out --payload "${PAYLOAD}" /tmp/response.json && cat /tmp/response.json | jq -r '.body' | jq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment