mix aws_lambda.build (AWS Lambda Runtime v0.1.1)

View Source

Builds this project's Lambda release inside the prebuilt Elixir builder image and downloads the resulting deployment zip.

Run from your function app's directory, passing the Erlang and Elixir versions to build with:

mix aws_lambda.build 29.0.5 1.20.3

What it does

  1. Pulls the ghcr.io/groguelon/lambda-layer-elixir:<elixir>-erlang-<erlang>-arm64 image, erroring out if no image matches the given versions.
  2. Creates a container from that image.
  3. Installs tar (and any --dep packages) in the container via dnf (the image doesn't ship with tar).
  4. Copies this app's source into it.
  5. Runs mix deps.get and mix release inside the container (fetching :aws_lambda_runtime and any other declared deps).
  6. Zips the release directory inside the container.
  7. Copies the zip back out to the host.
  8. Removes the container.

Options

  • --release / -r - name of the release to build. Defaults to the first release declared in mix.exs.
  • --output / -o - where to write the zip on the host. Defaults to _build/<release>.zip.
  • --platform - Docker platform to run for. Defaults to linux/arm64.
  • --dep / -d - extra dnf package to install in the container alongside tar (e.g. because a dep needs git to fetch). May be given multiple times.

Summary

Functions

Entry point invoked by mix aws_lambda.build. See the moduledoc for details.

Functions

run(args)

Entry point invoked by mix aws_lambda.build. See the moduledoc for details.