This is a Kotlin multiplatform template project used to generate and deploy a natively compiled AWS lambda function using the custom runtime.

Overview

Overview

This is a Kotlin multiplatform template project used to generate and deploy a natively compiled AWS Lambda function using a custom runtime. Using a natively compiled image greatly improves startup and execution time, and reduces memory consumption, relative to relying on the Java Virtual Machine. By using the graalvm-native compiler, the Lambda function can continue to utilize the AWS Java SDK and other JVM libraries.

It includes the following:

  • A "Hello, world" AWS lambda function implemented with Kotlin and using the AWS Java SDK
  • Use of the ShadowJar gradle plugin to create a single JAR file with the lambda function and all dependencies
  • Creates a Docker image using amazonlinux to be used by the native compilation step
  • Uses the graalvm native compiler to create a binary executable that can be run in an AWS custom lambda runtime
  • Uses the AWS CDK to deploy the lambda function to the server

Build and Deploy

1. Install the AWS Cloud Development Kit (CDK)

2. Install Docker

3. Build and deploy the lambda function to AWS

cd deploy

If using windows:

cdk --profile <awsprofile> deploy --app "..\gradlew run"

if using linux:

cdk --profile <awsprofile> deploy --app "../gradlew run"

where <awsprofile> should be replaced with the profile you wish to use for deploying to AWS.

When a prompt displays asking if you wish to deploy the changes, select 'y'.

Testing

Log in to the AWS Lambda console. Navigate to the "helloWorld" function. From here choose the Test tab. It should look like the below image:

For Template, use hello-world (it should be selected by default), and press the Test button.

The lambda function will return the String "Hello, world!" and is reported by the AWS console as shown in the below image:

You might also like...
Kotlin multiplatform library template.

template-kmp-library Kotlin multiplatform library template. Has a baseline setup for a multiplatform library supporting all kotlin targets except andr

Kotlin Multiplatform Mobile App Template

KMMT : Kotlin Multiplatform Mobile Template Kotlin Multiplatform Mobile Development Simplified KMMT is a KMM based project template designed to simpli

Kotlin multiplatform library template

template-kmp-library Kotlin multiplatform library template. Has a baseline setup for a multiplatform library supporting all kotlin targets except depr

Multi module architecture Android template project using MVVM, Dagger-Hilt, and Navigation Components
Multi module architecture Android template project using MVVM, Dagger-Hilt, and Navigation Components

ModularAppTemplate An Android template project following a multi module approach with clean architecture. It has been built following Clean Architectu

This program will read from your android application string.xml file and generate translated strings.xml files in your preferred languages using google sheet.
This program will read from your android application string.xml file and generate translated strings.xml files in your preferred languages using google sheet.

Localize your application content This program will read from your application string.xml file and generate translated strings.xml files in your prefe

An Android template project (in Kotlin) with boilerplate and current patterns.

android-starter-v4 An Android template project (in Kotlin) with boilerplate and plumbing, exploring current architecture patterns. A bit too much for

A Kotlin Multiplatform Project using TMDB Api. Currently supports Android,iOS,Desktop and web platforms
A Kotlin Multiplatform Project using TMDB Api. Currently supports Android,iOS,Desktop and web platforms

A Kotlin Multiplatform Project using TMDB Api(https://www.themoviedb.org/). Currently this project is implemented in following platforms Andr

Spring boot web + Kotlin template project

kotpringboot-multimodule-template Table of Contents Overview How to run Overview How to run Run with profiles: Note that default spring profile would

Auto-generate the fastest possible Parcelable implementations for Java and Kotlin

This project is deprecated It will still be maintained, but no new features will be added. Please use Parcelize, as it is the official way of generati

Owner
Greg Steckman
Greg Steckman
Runtime Mobile Security (RMS) 📱🔥 - is a powerful web interface that helps you to manipulate Android and iOS Apps at Runtime

Runtime Mobile Security (RMS) ?? ?? by @mobilesecurity_ Runtime Mobile Security (RMS), powered by FRIDA, is a powerful web interface that helps you to

Mobile Security 2k Dec 20, 2022
An android lib that provides most commonly used utility function

Awesome-Utility An android lib that provides most commonly used utility function. It can help Android developers with supporting common utility functi

Ameer Hamza 2 Apr 5, 2022
Kotlin/JVM Lambda example

kotlin-lambda-example-jvm Kotlin Lambda example on JVM contains four CDK stacks of Kotlin Lambda on JVM: JVM on x86, JVM on Arm64, JVM with C1 compile

Elena van Engelen - Maslova 2 Nov 8, 2022
Arrow-Maven-Template - A template project for Arrow with Maven. It defines an application and a couple small examples

Arrow-Maven-Template A template project for Arrow on Maven. See the official doc

ΛRROW 0 Jan 11, 2022
Kotlin Multiplatform runtime infix expressions evaluator.

Kotlin multiplatform expressions evaluator This is a kotlin multiplatform runtime infix expressions evaluator. Overview Operators The library supports

Azamat Murzagalin 13 Dec 30, 2022
Code generation of Kotlin DSL for AWS CDK

Code generation of Kotlin DSL for AWS CDK

Semantic Configuration 5 Dec 24, 2022
A Kotlin Multiplatform and Compose template that allows you to easily set up your project targeting: Android, Desktop, and Web

A Kotlin Multiplatform and Compose template that allows you to easily set up your project targeting: Android, Desktop, and Web

Carlos Mota 3 Oct 27, 2021
A Gradle plugin for Kotlin Multiplatform projects that generate a XCFramework for Apple targets or a FatFramework for iOS targets, and manages the publishing process in a CocoaPod Repository.

KMP Framework Bundler KMP Framework Bundler is a Gradle plugin for Kotlin Multiplatform projects that generate a XCFramework for Apple targets or a Fa

Marco Gomiero 17 Oct 29, 2022
🍼Debug Bottle is an Android runtime debug / develop tools written using kotlin language.

???? 中文 / ???? 日本語 / ???? English ?? Debug Bottle An Android debug / develop tools written using Kotlin language. All the features in Debug bottle are

Yuriel Arlencloyn 846 Nov 14, 2022
An experimental tool for building console UI in Kotlin using the Jetpack Compose compiler/runtime

An experimental tool for building console UI in Kotlin using the Jetpack Compose compiler/runtime

Jake Wharton 1.4k Dec 28, 2022