GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - aleph0io/example-java-lambda-function: Example Java Lambda Function Using Custom Base Image

BranchesTags
Open more actions menu

Latest commit

 

History

44 Commits
44 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src/main/java/com/sigpwned/lambda/hello
src/main/java/com/sigpwned/lambda/hello
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 
test-input.png
test-input.png
 
 
test-output.png
test-output.png
 
 

Repository files navigation

Example Java Lambda Function

Introduction

This is a (simple) example AWS Lambda function using my Custom Java Lambda Base Image. You can always find the base images in the ECR Public Gallery. Note that as of the time of this writing, the base image only supports x86_64, so build your images accordingly.

Build

You can build it using maven. (Don't forget to replace $AWS_ACCOUNT_ID and $AWS_REGION with your values.)

$ mvn -Daws.account=$AWS_ACCOUNT_ID -Daws.region=$AWS_REGION clean compile install

Next, you'd push your image to an ECR repository called example-java-lambda-function in your account. I assume you've already created it. Make sure it's in the right region! You also must have already set up authentication in your awscli instance.

$ aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com

Finally, you'd create a new Lambda function with your container. Then you can test it in the console:

AWS Console Test Input

AWS Console Test Output

Future Work

I may add a CloudFormation template using SAM to make running this example easier.

About

Example Java Lambda Function Using Custom Base Image

Topics

aws-lambdajava

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

8 stars

Watchers

1 watching

Forks

1 fork
Report repository

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.