capabilities.work

Deploy and Invoke Function

A 4-step recipe with Amazon Lambda. We can help you get access.

Recipe · 4 steps

Deploy and Invoke Function

Create a function, poll until Active, and invoke it.

  1. Create the Lambda function from the supplied runtime, role, and handler. The function is typically returned in the Pending state.
  2. Poll the function until Lambda reports it has finished provisioning. A State of Active continues to invocation; a State of Failed branches to the failure handler.
  3. Invoke the now-Active function with the supplied event payload and capture the response.
  4. Re-read the function configuration when it has entered the Failed state so the caller can surface the terminal state.
What you'll need to have ready
  • FunctionName: The name of the Lambda function to create (e.g. my-function).
  • Runtime: The function's runtime identifier (e.g. python3.12).
  • Role: The execution role ARN the function assumes when invoked.
  • Handler: The handler Lambda calls to begin execution.
  • Description: An optional description for the function.
  • Timeout: The number of seconds Lambda allows the function to run.
  • MemorySize: The amount of memory (in MB) available to the function.
  • invocationPayload: The JSON event payload to send to the function on invocation.
For your developer

Arazzo workflow amazon-lambda:deploy-and-invoke-function, 4 operations: CreateFunction → GetFunction → InvokeFunction → GetFunction. Specs on APIs.io.