Code Monkey home page Code Monkey logo

aws-iam-db-access-dbcp's Introduction

misoboy/aws-iam-db-access-dbcp

AWS IAM Database Authentication using Apache Common DBCP connection pool

Installation

git clone https://github.com/misoboy/aws-iam-db-access-dbcp.git

Overview

AWS RDS, Redshift IAM Access authentication method is applied to Apache Common DBCP to create a token when a connection pool is created, and connect to the database.

This source code is compatible with Apache Common DBCP versions v1, v2.

Usage

The example is implemented as a Junit Test case to create a Connection.

You need to modify the jdbc connection properties. test/resources/application-test.properties

# Region
datasource.rds.region=ap-northeast-2
# AWS RDS Service Endpoint
datasource.rds.endpoint=
# AWS RDS Service Port
datasource.rds.port=
# AWS RDS Username
datasource.rds.username=
datasource.rds.driverClassName=com.mysql.cj.jdbc.Driver
# AWS RDS JDBC URL
datasource.rds.url=

# Region
datasource.redshift.region=ap-northeast-2
# AWS Redshift Cluster ID
datasource.redshift.clusterId=
# AWS Redshift Username
datasource.redshift.username=
datasource.redshift.driverClassName=com.amazon.redshift.jdbc.Driver
# AWS Redshift JDBC URL
datasource.redshift.url=

Set AWS CLI authentication information for your environment.

Edit $USER_HOME/.aws/config.

[default]
output = json
region = ap-northeast-2

[my-profile]
output = json
region = ap-northeast-2

Edit $USER_HOME/.aws/credentials.

[default]
aws_access_key_id = ...
aws_secret_access_key = ...

[my-profile]
aws_access_key_id = ...
aws_secret_access_key = ...

Go to the project workspace root path. Run Maven Junit Test case.

$ mvn clean test -Daws.profile=If omitted, the default profile is used.

aws-iam-db-access-dbcp's People

Contributors

chiseok avatar misoboy avatar nuax79 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.