Skip to content

rmpt/aws-lambda-kotlin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-lambda-kotlin

AWS Lambda function written in kotlin.

The steps explaining the code can be found here.

Generate a fat jar

Run this in the project root, it generates a fat jar that can be found under lib/build/libs/lib-all.jar

./gradlew shadowJar

Deploy to AWS

These commands should be run inside the lib folder/module. THey will create an S3 bucket to store the final template and use that final template to deploy the function.

  1. aws s3 mb s3://lambda-kotlin
  2. aws cloudformation package –template-file template.yml –s3-bucket lambda-kotlin –output-template-file template-out.yml
  3. aws cloudformation deploy –template-file template-out.yml –stack-name lambda-kotlin –capabilities CAPABILITY_NAMED_IAM

Test

aws lambda invoke --function-name <your_function_name> --payload '{ "content": "Hey!" }' out.json

out.json file will contain the content of the response, something like: {"content":"Echo: Hey!"}

About

AWS Lambda funciton written in kotlin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages