https://github.com/elenavanengelenmaslova/kotlin-lambda-example-jvm
Kotlin/JVM Lambda examples on x86 and ARM64 with and without C1 compiler optimisation, Infra as Code in AWS CDK in Kotlin
https://github.com/elenavanengelenmaslova/kotlin-lambda-example-jvm
arm64 aws aws-lambda kotlin
Last synced: 8 months ago
JSON representation
Kotlin/JVM Lambda examples on x86 and ARM64 with and without C1 compiler optimisation, Infra as Code in AWS CDK in Kotlin
- Host: GitHub
- URL: https://github.com/elenavanengelenmaslova/kotlin-lambda-example-jvm
- Owner: elenavanengelenmaslova
- License: mit
- Created: 2022-10-04T17:44:39.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-04T10:55:02.000Z (over 2 years ago)
- Last Synced: 2024-04-28T01:33:50.326Z (about 2 years ago)
- Topics: arm64, aws, aws-lambda, kotlin
- Language: Kotlin
- Homepage:
- Size: 376 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kotlin-lambda-example-jvm
Kotlin Lambda example on JVM contains six CDK stacks of Kotlin Lambda on JVM: JVM on x86, JVM on Arm64, JVM with C1 compiler on x86, JVM with C1 compiler on Arm64, JVM with SnapStart on x86, JVM with SnapStart and C1 compiler on x86, and one stack for Dynamo Table. x86 and ARM64 examples were used in performance tests for "To ARM64 or not to ARM64" article: https://medium.com/aws-tip/this-week-in-kotlin-on-aws-lambda-to-arm64-or-not-to-arm64-e970f97baef3
## Build & Deployment from local machine
### Build kotlin app
Unit tests are using Testcontainers to run DynamoDB locally.
Ensure docker is running locally, then execute:
```
./gradlew clean build
```
### Set up CDK deployment
Install CDK (if you have not already):
```
npm install -g aws-cdk
```
If you have not set up CDK in you AWS account yet, please run (replace variables in brackets with actual values):
```
cdk bootstrap aws://[aws_account_id]/[aws_region]
```
Now deploy all stacks:
```
cdk deploy -vv --require-approval never --all
```
## Build & Deployment to AWS account from GitHub
Set up the following secrets in your GitHub project:
```
AWS_ACCOUNT_ID
AWS_ACCESS_KEY
AWS_SECRET_KEY
```
Update AWS region in `workflow-build-deploy.yml` in `.github` folder of the project