项目作者: sixhours-team

项目描述 :
AWS Lambda integration with MySQL Relational Database
高级语言: Java
项目地址: git://github.com/sixhours-team/aws-lambda-jdbc-java.git
创建时间: 2017-05-18T17:48:45Z
项目社区:https://github.com/sixhours-team/aws-lambda-jdbc-java

开源协议:

下载


Build Status

AWS Lambda JDBC Java

This is a sample project showing the AWS Lambda integration with MySQL relational database.

When triggered the lambda function will access the employee table (schema) in the MySQL RDS instance
that you created in the VPC, and return the list of all employees found in the table. The connection to the database is
obtained using the DataSource interface.

AWS Lambda might reuse container when lambda function is invoked again. Any declarations in lambda function code (outside
the handler method) remains initialized e.g. database connections. Instead of reestablishing the new connection, the
original connection is used in subsequent invocations. For this reason the HikariCP JDBC connection pool is used.

Build

To build and package the lambda function run following gradle command:

  1. ./gradlew clean build

The resulting .zip deployment package can be found in build/distributions directory of the project.

Properties

Lambda configuration properties can be set in your application.yml file. Below is the full list of supported properties
for the lambda function:

  1. datasource:
  2. url: # DB url
  3. username: # DB username
  4. password: # DB password

Usage

Build the project and create the lambda function by uploading the .zip deployment package using the AWS Management Console
or the AWS CLI.