Skip to content

Ducharme/awsCustomLambdas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Related information

How to configure custom docker images for AWS lambda functions (ubuntu with bash/shell & nodejs - Medium article written by me

Prerequisites

  1. AWS CLI v2 configured
  2. Docker installed
  3. git configured
  4. jq installed
  5. zip installed

Setup

  1. git clone https://github.com/Ducharme/awsCustomLambdas
  2. Update values in file set_project_values.sh (defaults are PROJECT_NAME=hello and DOCKERFILE=Dockerfile_ubuntu)
  • PROJECT_NAME: Lowercase string without space plus dash '-' char are valid
  • DOCKERFILE: Dockerfile_aws or Dockerfile_bookworm or Dockerfile_ubuntu or NA (for custom image from zip file)
  1. sh build_image.sh Note: Only for functions using docker image
  2. sh create_role.sh
  3. sh create_lambda.sh
  4. sh create_api.sh

Single test in your current region

  1. sh run_container_locally.sh Note: Only for functions using docker image
  2. sh run_function_remotely.sh
  3. sh run_function_from_apigw.sh

Global test accross multiple regions

  1. sh test_cold_start_by_region.sh
  2. sh run_function_by_region.sh

Clean up

Simply run sh cleanup.sh to delete all resources at once

  • API Gateway / APIs ($PROJECT_NAME-api)
  • Lambda / Functions ($PROJECT_NAME-lambda)
  • Amazon ECR / Repositories ($PROJECT_NAME-repo)
  • IAM / Roles ($PROJECT_NAME-lambda-role)
  • CloudWatch / Log groups (/aws/lambda/$PROJECT_NAME-lambda)
  • CloudWatch / Log groups (/aws/apigw/$PROJECT_NAME-api)

Documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published