Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add aws funqy support #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@ Our goal was to have functions with a low memory footprint and extremely fast co

> mvn package -Pnative -Dquarkus.native.container-build=true

## AWS
Specify your function in the ``application.properties`` with ``quarkus.funqy.export=helloWorld``.

The function name is based on the function in the ``HelloWorldFunction.class`` in the case it`s ``helloWorld``.

You need to add ``LAMBDA_ROLE_ARN`` with your role to your enviroment variables or add it to the ``manage.sh`` file.

### Native deployment

> mvn package -Pnative -Dquarkus.native.container-build=true

> sh target/manage.sh native create

## Testing
You can use the SAM CLI to test your aws lamda locally.

### JVM
> sam local invoke --template target/sam.jvm.yaml --event payload.json

### Native
> sam local invoke --template target/sam.native.yaml --event payload.json

## Sources

[Quarkus - Building native image](https://quarkus.io/guides/building-native-image)

[Quarkus - Funqy Amazon Lamda](https://quarkus.io/guides/funqy-amazon-lambda)
4 changes: 4 additions & 0 deletions payload.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"username": "testUser"

}
EzxD marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
<artifactId>quarkus-funqy-http</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-funqy-amazon-lambda</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class UserFunction {

@Inject
private UserService userSer;
UserService userSer;

@Funq
public void createUser(@Valid UserDTO userDTO) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public class UserService {

@Inject
private UserRepository userRepository;
UserRepository userRepository;

@Transactional
public void createUser(String username) {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
#quarkus.datasource.jdbc.url = jdbc:postgresql://localhost:5432/mydatabase
#quarkus.datasource.driver=org.postgresql.Driver
quarkus.hibernate-orm.database.generation=drop-and-create
quarkus.funqy.export=helloWorld
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class RepositoryTest {

@Inject
private UserRepository userRepository;
UserRepository userRepository;

@Test
@Transactional
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ quarkus.datasource.db-kind=h2
quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test
quarkus.hibernate-orm.database.generation=drop-and-create
quarkus.hibernate-orm.log.sql=true
quarkus.funqy.export=helloWorld