Following steps here will theoretically allow you to put a kotlin function into AWS Lambda.
You need an AWS account!
- Checkout this repo
git checkout https://github.com/hshar7/kotlin-lambda
- Do
mvn package
- Head over to aws lambda and click create a new lambda function
- Give it a name and select latest Java as runtime
- Make a role or select an existing role. Defaults for role is fine.
- Scroll down and browse press Upload to select the jar file your created under target:
kotlin_lambda_starter-1.0.jar
- Handler name:
com.hshar.WebServer
- You cannot test it yet!
- Go to API Gateway in AWS
- Create API -> New API
- Give it a name and choose Edge Optimized.
- Actions -> Create Resource
- Checkbox proxy resource and click Create Resource
- Press on any under proxy then Test on the left side in Client
- Method -> GET, Path -> /hello .. then click Test
- Yeay!
https://github.com/hshar7/kotlin-lambda-notes-service