jenspapenhagen / lambdatest

PoC for aws lamdba and quarkus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PRE REQUISITES

  • aws sam
  • docker
  • (gradle)

build for regular JVM

./gradlew build

build as native image

./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true -Dquarkus.native.container-runtime=docker

After you run the build, there are a few extra files generated by the Quarkus lambda extension you are using. These files are in the the build directory: build/ for Gradle.

function.zip - lambda deployment file
sam.jvm.yaml - sam cli deployment script
sam.native.yaml - sam cli deployment script for native

deploy jvm version

sam deploy -t build/sam.jvm.yaml -g

deploy native version

sam deploy -t build/sam.native.yaml -g

testing out the API

after deployment is done you'll see this in the terminal

Outputs                                                                                                        
------------------------------------------------------------------------------------------
Key                 QuarkusrestApi                                                                                 
Description         URL for application                                                                            
Value               https://<?your_random_id?>.execute-api.us-east-1.amazonaws.com/                                        
------------------------------------------------------------------------------------------

make a GET request to the outputted URL with /hello added to the end

push an update

sam deploy --template-file sam.jvm.yaml --stack-name jvm-quarkus --capabilities CAPABILITY_IAM
#or
sam deploy --template-file sam.native.yaml --stack-name quarkus-native --capabilities CAPABILITY_IAM

About

PoC for aws lamdba and quarkus


Languages

Language:Java 100.0%