Amazon AppFlow Custom JDBC Connector example

Overview

Amazon AppFlow Custom JDBC Connector example

This project contains source code and supporting files that implements Amazon Custom Connector SDK and represents a JDBC connector example. You can deploy this the SAM CLI. It includes the following files and folders.

  • src/main - Code for the application's Lambda function.
  • src/test - Unit tests for the application code.
  • template.yaml - A SAM template that defines the application's AWS resources.

The application uses AWS Lambda function with concrete IAM policy following the least-privileges principle. These resources are defined in the template.yaml file in this project. You can update the template to add other AWS resources through the same deployment process that updates your application code.

Important considerations and path to production

The code provided with this example is aimed to demonstrate how you can use the Amazon AppFlow Custom SDK, and is not production ready code. It is important to understand the additional effort necessary to build a production-ready solution from this Proof of Concept. We have produced a non-exhaustive list of gaps that we believe exist between the Proof of Concept and a production-ready solution.

The gaps are categorized into few Perspectives; one being focused purely on functional aspects of the solution and the others coming from AWS Cloud Adoption Framework (AWS CAF).

The AWS CAF helps organizations understand how cloud adoption transforms the way they work, and it provides structure to identify and address gaps in skills and processes. Looking at the solution from AWS CAF perspectives results in an actionable plan with defined work streams that can guide your organization to effectively deriving value from implementing your cloud-based solution in production. This framework leverages our experiences and best practices in assisting organizations around the world with their cloud adoption journey.

More information can be found at on AWS CAF page

Perspective (6 CAF + Functional) Category Recommendation
Security Security
Operations Monitoring You should include the components deployed by the Proof of Concept in your own Monitoring tools.
Operations Logging & Alerting The Proof of Concept has been configured to output all logs to CloudWatch. You need to integrate this log data into your own logging system.
Platform Automate release management Introduce application lifecycle and route to production by using several environments
Platform Automate resources provisioning Introduce infrastructure and application configuration automation to accelerate the path to production
People Upskilling the workforce People trained to support and evolve the solution on the infrastructure and application level
Security Identity and Access Management Fine-grained policies and roles associated with appropriate users and groups created to reduce human access to production systems and data.
Security Infrastructure Security Implement a security baseline including trust boundaries, system security configuration and maintenance (e.g., harden and patch), and other appropriate policy enforcement points
Security Infrastructure Security Consider adding VPC and S3 VPC endpoint where applicable.
Security Data Protection Utilize appropriate safeguards to protect data in transit and at rest. Safeguards include fine-grained access controls to objects, creating and controlling the encryption keys used to encrypt your data and key rotation strategies for the database connectivity credentials.
Security Incident Response Review current incident response processes and determine if and how automated response and recovery will become operational and managed for AWS assets.
Operations Tagging & Cost Optimization Introduce tagging to control and optimize infrastructure cost
Operations Resiliency Architect your solution to deliver against HA/DR/BC requirements you have
Operations Release and Change Management processes Create capability to manage, plan, and schedule changes to the solution, if needed
Platform Path to Production Implement lifecycle policies for any data stored durably on destination S3 buckets, so that obsolete data is automatically removed.
Security Data Protection JDBC and ODBC drivers does not encrypt your data for transmission. To provide security for the database traffic you need to tunnel the ODBC traffic through the network using Secure Shell, Secure Sockets Layer, Point-to-Point tunneling, Protocol/Layer 2 Tunneling Protocol or IPSec.

Deploy the sample application

The Serverless Application Model Command Line Interface (SAM CLI) is an extension of the AWS CLI that adds functionality for building and testing Lambda applications. It uses Docker to run your functions in an Amazon Linux environment that matches Lambda. It can also emulate your application's build environment and API.

To use the SAM CLI, you need the following tools.

To build and deploy your application for the first time, run the following in your shell:

mvn package
sam deploy --guided

The first command will build the source of your application. The second command will package and deploy your application to AWS, with a series of prompts:

  • Stack Name: The name of the stack to deploy to CloudFormation. This should be unique to your account and region, and a good starting point would be something matching your project name.
  • AWS Region: The AWS region you want to deploy your app to.
  • Confirm changes before deploy: If set to yes, any change sets will be shown to you before execution for manual review. If set to no, the AWS SAM CLI will automatically deploy application changes.
  • Allow SAM CLI IAM role creation: Many AWS SAM templates, including this example, create AWS IAM roles required for the AWS Lambda function(s) included to access AWS services. By default, these are scoped down to minimum required permissions. To deploy an AWS CloudFormation stack which creates or modifies IAM roles, the CAPABILITY_IAM value for capabilities must be provided. If permission isn't provided through this prompt, to deploy this example you must explicitly pass --capabilities CAPABILITY_IAM to the sam deploy command.
  • Save arguments to samconfig.toml: If set to yes, your choices will be saved to a configuration file inside the project, so that in the future you can just re-run sam deploy without parameters to deploy changes to your application.

Add a resource to your application

The application template uses AWS Serverless Application Model (AWS SAM) to define application resources. AWS SAM is an extension of AWS CloudFormation with a simpler syntax for configuring common serverless application resources such as functions, triggers, and APIs. For resources not included in the SAM specification, you can use standard AWS CloudFormation resource types.

Fetch, tail, and filter Lambda function logs

To simplify troubleshooting, SAM CLI has a command called sam logs. sam logs lets you fetch logs generated by your deployed Lambda function from the command line. In addition to printing the logs on the terminal, this command has several nifty features to help you quickly find the bug.

NOTE: This command works for all AWS Lambda functions; not just the ones you deploy using SAM.

sam logs -n ConnectorFunction --stack-name <stack-name-provided-during-sam-deploy> --tail

You can find more information and examples about filtering Lambda function logs in the SAM CLI Documentation.

Result

Integrating MySQL source to a MySQL destination would yield results like:

MySQL-MySQL

Also, with this custom JDBC connector you can ship records from MySQL to S3 and the results would look like:

MySQL-S3

Cleanup

To delete the sample application that you created, use the AWS CLI. Assuming you used your project name for the stack name, you can run the following:

sam delete

Resources

See the AWS SAM developer guide for an introduction to SAM specification, the SAM CLI, and serverless application concepts.

Next, you can use AWS Serverless Application Repository to deploy ready to use Apps that go beyond hello world samples and learn how authors developed their applications: AWS Serverless Application Repository main page

You might also like...

Online Quiz system - JDBC, JSP

Online-Quiz-System-in-Java Online Quiz system - JDBC, JSP Java Project based on JDBC, JSP, Java Servlet and Server Deployment Project Aim Develop web

Oct 14, 2022

Hi, Spring fans! In this installment, we'll look at how to build tenancy-aware JDBC applications

Multitenant JDBC You'll need to spin up two separate PostgreSQL instances. Put this script into a file called postgres.sh: #!/usr/bin/env bash NAME=${

Nov 7, 2022

esProc SPL is a scripting language for data processing, with well-designed rich library functions and powerful syntax, which can be executed in a Java program through JDBC interface and computing independently.

esProc SPL is a scripting language for data processing, with well-designed rich library functions and powerful syntax, which can be executed in a Java program through JDBC interface and computing independently.

esProc esProc is the unique name for esProc SPL package. esProc SPL is an open-source programming language for data processing, which can perform comp

Dec 27, 2022

A JDBC driver for Cloudflare's D1 product, compatible with Jetbrains tools.

A JDBC driver for Cloudflare's D1 product, compatible with Jetbrains tools.

D1 JDBC Driver A JDBC driver for Cloudflare's D1 Database product! JDBC is the technology that drives popular database tools such as Jetbrains' databa

Dec 9, 2022

A custom placeholders plugin that utilizes the MongoDB database

A custom placeholder plugin that saves placeholders values to a Mongo Database (also per player support!)

Nov 30, 2022

🚀flink-sql-submit is a custom SQL submission client

🚀flink-sql-submit is a custom SQL submission client This is a customizable extension of the client, unlike flink's official default client.

Mar 28, 2022

A practical example to showcase Redis Streams and RediSearch in action

A practical example to showcase Redis Streams and RediSearch in action

Redis Streams in Action A practical example to showcase Redis Streams in action. The goal is to process Twitter data in real-time for search and query

Dec 19, 2022

Example Project which uses spark mongo connector !

mongo-spark-connector-springboot Example Project which uses spark mongo connector to read/aggregate & convert into Spark DataSet/Java RDDs Connects to

Dec 6, 2022

Spring Boot JdbcTemplate example with SQL Server: CRUD Rest API using Spring Data JDBC, Spring Web MVC

Spring Boot JdbcTemplate example with SQL Server: Build CRUD Rest API Build a Spring Boot CRUD Rest API example that uses Spring Data Jdbc to make CRU

Dec 20, 2022

Amazon Selling Partner JAVA SDK SP API

amazon-sp-api amazon sp api java sdk 背景: 亚马逊(amazon)在2020年10月推出了新的替代mws的api方案,称为Selling Partner API(SP-API)。sp-api在修改原mws的接口方式的基础上引入了aws的IAM权限管理,增加了开发

Nov 20, 2022

Abstract the use of amazon lex / google dialog flow, while also support complex conditional flows

amazon-lex-gcp-diaglogflow-abstraction on simply put: ALGDA :) In this project I try to abstract the use of amazon lex first, but then also google's d

Apr 19, 2021

Some recent questions asked in interviews of companies like Google, TCS, Amazon etc.

Some recent questions asked in interviews of companies like Google, TCS, Amazon etc.

Nov 21, 2022

Aggregation query proxy is a scalable sidecar application that sits between a customer application and Amazon Keyspaces/DynamoDB

Aggregation query proxy is a scalable sidecar application that sits between a customer application and Amazon Keyspaces/DynamoDB

Aggregation query proxy is a scalable sidecar application that sits between a customer application and Amazon Keyspaces/DynamoDB. It allows you to run bounded aggregation queries against Amazon Keyspaces and DynamoDB services.

Jul 18, 2022

基于Apache-bahir-kudu-connector的flink-connector-kudu,支持Flink1.11.x DynamicTableSource/Sink,支持Range分区等

基于Apache-Bahir-Kudu-Connector改造而来的满足公司内部使用的Kudu Connector,支持特性Range分区、定义Hash分桶数、支持Flink1.11.x动态数据源等,改造后已贡献部分功能给社区。

Jul 27, 2022

A tool based on mysql-connector to simplify the use of databases, tables & columns

A tool based on mysql-connector to simplify the use of databases, tables & columns

Description A tool based on mysql-connector to simplify the use of databases, tables & columns. This tool automatically creates the databases & tables

Nov 17, 2022

Flink Connector for Apache Doris(incubating)

Flink Connector for Apache Doris (incubating) Flink Doris Connector More information about compilation and usage, please visit Flink Doris Connector L

Dec 20, 2022

A sidecar to run alongside Trino to gather metrics using the JMX connector and expose them in different formats using Apache velocity

Overview A sidecar to run alongside Trino to gather metrics using the JMX connector and expose them in different formats using Apache Velocity. Click

Nov 18, 2021

GalaxyGlue is an extension to MySQL Connector/J 8.0.

中文文档 What is ApsaraDB GalaxyGlue ? GalaxyGlue is an extension to MySQL Connector/J 8.0. GalaxyGlue uses asynchronous requests, session and connection

Dec 19, 2022

flink-connector-redis

github: https://github.com/future94/flink-connector-redis gitee : https://gitee.com/future94/flink-connector-redis Stargazers over time 为什么写这个项目 对比其他的

Aug 30, 2022
Comments
  • Feat tidb

    Feat tidb

    Issue #, if available:

    Description of changes:

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by Icemap 0
Owner
AWS Samples
AWS Samples
A tool based on mysql-connector to simplify the use of databases, tables & columns

Description A tool based on mysql-connector to simplify the use of databases, tables & columns. This tool automatically creates the databases & tables

nz 6 Nov 17, 2022
Flink Connector for Apache Doris(incubating)

Flink Connector for Apache Doris (incubating) Flink Doris Connector More information about compilation and usage, please visit Flink Doris Connector L

The Apache Software Foundation 115 Dec 20, 2022
flink-connector-redis

github: https://github.com/future94/flink-connector-redis gitee : https://gitee.com/future94/flink-connector-redis Stargazers over time 为什么写这个项目 对比其他的

invalley 3 Aug 30, 2022
光 HikariCP・A solid, high-performance, JDBC connection pool at last.

HikariCP It's Faster.Hi·ka·ri [hi·ka·'lē] (Origin: Japanese): light; ray. Fast, simple, reliable. HikariCP is a "zero-overhead" production ready JDBC

Brett Wooldridge 17.7k Jan 1, 2023
Vibur DBCP - concurrent and dynamic JDBC connection pool

Vibur DBCP is concurrent, fast, and fully-featured JDBC connection pool, which provides advanced performance monitoring capabilities, including slow S

Vibur 94 Apr 20, 2022
JDBC driver for ClickHouse

This is a basic and restricted implementation of jdbc driver for ClickHouse. It has support of a minimal subset of features to be usable.

ClickHouse 1.1k Jan 1, 2023
Multi-DBMS SQL Benchmarking Framework via JDBC

BenchBase BenchBase (formerly OLTPBench) is a Multi-DBMS SQL Benchmarking Framework via JDBC. Table of Contents Quickstart Description Usage Guide Con

CMU Database Group 213 Dec 29, 2022
Provides many useful CRUD, Pagination, Sorting operations with Thread-safe Singleton support through the native JDBC API.

BangMapleJDBCRepository Inspired by the JpaRepository of Spring framework which also provides many capabilities for the CRUD, Pagination and Sorting o

Ngô Nguyên Bằng 5 Apr 7, 2022
Core ORMLite functionality that provides a lite Java ORM in conjunction with ormlite-jdbc or ormlite-android

ORMLite Core This package provides the core functionality for the JDBC and Android packages. Users that are connecting to SQL databases via JDBC shoul

Gray 547 Dec 25, 2022
SPRING MySQL Database Connection using JDBC STEPS

SPRING-MySQL-Database-Connection-using-JDBC-STEPS SPRING MySQL Database Connection using JDBC STEPS Step1: Create maven project Group id: com.cdac Art

Dnyaneshwar Madhewad 1 Jan 27, 2022