Skip to contents

deploy a local lambda image to AWS Lambda

Usage

deploy_lambda(tag, set_aws_envvars = FALSE, ...)

Arguments

tag

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

set_aws_envvars

logical, whether to set the local AWS secrets to the deployed Lambda environment (default = `FALSE`). This is useful if the Lambda needs to access other AWS service. When `TRUE`, the following envvars are set: `PROFILE`, `REGION`, `SECRET_ACCESS_KEY`, and `ACCESS_KEY_ID`. They are fetched using `Sys.getenv()`.

...

Arguments passed onto `create_lambda_function`

Examples

if (FALSE) { # \dontrun{

  runtime_function <- "parity"
  runtime_path <- system.file("parity.R", package = "r2lambda")
  dependencies <- NULL

  build_lambda(
    tag = "myrepo52",
    runtime_function = runtime_function,
    runtime_path = runtime_path,
    dependencies = dependencies
    )

  deploy_lambda(tag = "myrepo52")

  invoke_lambda(
    function_name = "myrepo52",
    payload = list(number = 3),
    invocation_type = "RequestResponse"
    )

} # }