Skip to content

Latest commit

 

History

History
72 lines (50 loc) · 5.87 KB

README.md

File metadata and controls

72 lines (50 loc) · 5.87 KB

Demo API Gateway triggered Lambda

CI ECR cleanup Manual API call Renovate enabled Mergify enabled Scala CE3

Based on API Gateway's

  • HTTP API (not REST API) and
  • payload format version 2.0.

The Lambda function has less than 30 seconds to complete because of the HTTP API's maximum integration timeout on synchronous requests.

CI

Secrets

  • AWS_ACCOUNT_ID
  • AWS_REGION
  • ECR_REPO_NAME
  • LAMBDA_NAME
  • PROD_CI_ROLE_ARN

ECR cleanup

Delete all untagged ECR images except the most recent one.

Secrets

  • AWS_REGION
  • ECR_REPO_NAME
  • PROD_CI_ROLE_ARN

Manual API call

Secrets

  • PROD_BASE_URL

Docker

Build an image with

docker build --tag "<REPOSITORY:TAG>" \
  --build-arg "JAVA_VERSION=..." \
  --build-arg "SBT_VERSION=..." \
  --file "./Dockerfile" "."

(default JAVA_VERSION and SBT_VERSION values in Dockerfile).

Run the image with

docker run --rm --publish "9000:8080" "<REPOSITORY:TAG>"

and test it with

curl --silent \
  --request "POST" "http://localhost:9000/2015-03-31/functions/function/invocations" \
  --data '{"body":"hello world!","isBase64Encoded":false}' | \
  jq --raw-output '.' | jq '.'