Serverless "Hello World"-API written in Kotlin and using IaC using AWS CDK.
├── buildSrc # Shared Gradle build scripts
├── infrastructure # Infrastructure code via CDK (Java)
├── lambda # Holds business logic in AWS lambda functions
│ ├── hello-world # Lambda function module
└── ...
Build fat-jars for all Lambda functions
./gradlew shadowJar
cd infrastructure
cdk synth
cdk bootstrap # for first-time use
cdk deploy
Getting started with SAM and CDK
sam local generate-event apigateway http-api-proxy --method="GET" --path="hello-world" --body="eyAibmFtZSI6ICJEZXZlbG9wZXIiIH0=" > ../lambda/hello-world/src/test/resources/events/hello-world.json
sam local invoke hello-world-handler -t ./cdk.out/demo-stack.template.json -e ../lambda/hello-world/src/test/resources/events/request-default.json
sam local invoke hello-world-handler -t ./cdk.out/demo-stack.template.json -e ../lambda/hello-world/src/test/resources/events/request-body.json
sam local invoke hello-world-handler -t ./cdk.out/demo-stack.template.json -e ../lambda/hello-world/src/test/resources/events/request-query-param.json
sam local start-api -t ./cdk.out/demo-stack.template.json