Pass a JSON file to the Lambda's payload (#63261)

* Add an example of passing a JSON file to the Lambda's payload
Events passed to Lambda are commonly in JSON format, the change provides an example of using JSON file as an alternative to the inline YAML payload in the other examples.
This commit is contained in:
Saleh Batati 2019-10-09 16:10:32 -04:00 committed by Alicia Cozine
parent 5ed163ce3f
commit 1d5206f53e

View file

@ -106,7 +106,13 @@ EXAMPLES = '''
wait: true wait: true
tail_log: true tail_log: true
register: response register: response
# the response will have a `logs` key that will contain a log (up to 4KB) of the function execution in Lambda. # the response will have a `logs` key that will contain a log (up to 4KB) of the function execution in Lambda
# Pass the Lambda event payload as a json file.
- execute_lambda:
name: test-function
payload: "{{ lookup('file','lambda_event.json') }}"
register: response
- execute_lambda: - execute_lambda:
name: test-function name: test-function