Skip to contents

test a lambda locally

Usage

test_lambda(tag, payload)

Arguments

tag

The tag of an existing local image tagged with ECR repo (see `build_lambda`)

payload

Named list. Arguments to lambda function.

Value

Invisibly, the result of sys::exec_internal() for the `curl` call to the local container: a list with `status`, and `stdout` and `stderr` as raw vectors. The response is also printed.

Details

The container takes a moment to start, so the request is retried when the connection fails. If a connection drops after the function already ran, the function runs again, so a function with side effects, such as writing to S3, can run more than once.

Examples

if (FALSE) { # \dontrun{
  payload <- list(number = 2)
  test_lambda(tag = "parity1", payload)
} # }