{"id":19777990,"url":"https://github.com/aleph0io/example-java-lambda-function","last_synced_at":"2025-04-30T20:30:43.709Z","repository":{"id":48879915,"uuid":"517069907","full_name":"aleph0io/example-java-lambda-function","owner":"aleph0io","description":"Example Java Lambda Function Using Custom Base Image","archived":false,"fork":false,"pushed_at":"2024-01-15T15:04:53.000Z","size":362,"stargazers_count":8,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-25T07:03:23.617Z","etag":null,"topics":["aws-lambda","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aleph0io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-07-23T13:48:46.000Z","updated_at":"2023-03-28T20:47:18.000Z","dependencies_parsed_at":"2023-10-14T04:36:23.058Z","dependency_job_id":"92563231-b29d-4d22-aaed-51d4ed215602","html_url":"https://github.com/aleph0io/example-java-lambda-function","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleph0io%2Fexample-java-lambda-function","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleph0io%2Fexample-java-lambda-function/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleph0io%2Fexample-java-lambda-function/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleph0io%2Fexample-java-lambda-function/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleph0io","download_url":"https://codeload.github.com/aleph0io/example-java-lambda-function/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224223122,"owners_count":17276128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-lambda","java"],"created_at":"2024-11-12T05:27:23.306Z","updated_at":"2024-11-12T05:27:23.854Z","avatar_url":"https://github.com/aleph0io.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example Java Lambda Function\n\n## Introduction\n\nThis is a (simple) example AWS Lambda function using my [Custom Java Lambda Base Image](https://github.com/aleph0io/aws-lambda-java-base-images). You can always find the base images in the [ECR Public Gallery](https://gallery.ecr.aws/aleph0io/lambda/java). Note that as of the time of this writing, the base image only supports x86_64, so build your images accordingly.\n\n## Build\n\nYou can build it using maven. (Don't forget to replace `$AWS_ACCOUNT_ID` and `$AWS_REGION` with your values.)\n\n    $ mvn -Daws.account=$AWS_ACCOUNT_ID -Daws.region=$AWS_REGION clean compile install\n\nNext, 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.\n\n    $ aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com\n\nFinally, you'd [create a new Lambda function with your container](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-images.html). Then you can test it in the console:\n\n![AWS Console Test Input](/test-input.png)\n\n![AWS Console Test Output](/test-output.png)\n\n## Future Work\n\nI may add a CloudFormation template using SAM to make running this example easier.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleph0io%2Fexample-java-lambda-function","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleph0io%2Fexample-java-lambda-function","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleph0io%2Fexample-java-lambda-function/lists"}