claudiorodriguez / aws-ecr-lambda-example

Example of building a docker image for a lambda function, registering on ECR, etc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aws-ecr-lambda-example

codecov

Example / POC for Amazon Lambda container images. WORK IN PROGRESS

See Creating Lambda Container Images

This lambda function will accept the org querystring parameter and return an array with the repositories it finds by requesting https://api.github.com/orgs/{org}/repos (this is just a proof of concept)

Deploy Flow:

  • Build docker image
  • Push image to Amazon ECR (tag latest, scan on push)
  • Update Lambda function from container uri

Use Flow:

  • Request to Amazon Gateway
  • Run Lambda function
  • Fetch data from Github API

Dependencies:

  • Github Actions
  • Codecov
  • Docker
  • Amazon CLI
  • Amazon ECR
  • Amazon Lambda
  • Amazon Gateway

Tokens (in Github Actions):

  • Codecov (PR test coverage)
  • Amazon ECR (push image)
  • Amazon Lambda (update function code with image uri)

Local dev:

  • git clone
  • yarn start
  • curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"queryStringParameters":{"org":"nodejs"}}'

About

Example of building a docker image for a lambda function, registering on ECR, etc


Languages

Language:TypeScript 82.7%Language:JavaScript 9.2%Language:Dockerfile 4.2%Language:Shell 3.9%