Set up an AWS Lambda Java Function triggered by API Gateway


The other day I found myself in sudden need of returning customised responses for thousands of requests. Having no prior knowledge of the systems at play, and access to a free tier AWS account, I threw together a barebones Java project to solve this problem.

> github: aws-gateway-lambda


What's that? You like using Java in IntelliJ, and want to set up a simple API callback service on AWS, without all the bells and whistles of setting up the AWS Toolkit, opting instead for a barebones .jar file that will get the job done quick and fast for cheap? Well you've come to the semi-relevant place!

So what's this repo? A no-nonsense guide to set up some java code to be triggered via http request, without complicated server setup. It features:
  • Java
    • Maven
    • IntelliJ (Community Edition)
  • AWS Lambda
    • Run code from an uploaded JAR file.
    • Retrieve request parameters.
    • Set and read system environment variables.
    • CloudWatch Logging.
  • API Gateway
    • Hook AWS lambda up to a HTTP API, which is 2-3 times cheaper than a REST API configuration.