Skip to content

Instantly share code, notes, and snippets.

@zviryatko
Last active October 25, 2023 10:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zviryatko/395f29642bd2d29174c2b9954b8c89ae to your computer and use it in GitHub Desktop.
Save zviryatko/395f29642bd2d29174c2b9954b8c89ae to your computer and use it in GitHub Desktop.
Invoke aws lambda with http request
#!/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