psps97 / rds-secrets-sample

A sample project for using AWS RDS, Secrets and AWS Secrets Manager JDBC Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring Boot project using AWS RDS and Secrets Manager

This is a sample project to demonstrate how to apply Amazon RDS, AWS Secrets Manager and AWS Secrets Manager JDBC Library to a Spring Boot project

Read more at blog post Tích hợp Amazon RDS datasource vào Spring project dùng AWS Secrets Manager

Pre-requisites

A RDS instance up and running. A secret (AWS Secrets Manager) which stores the RDS instance's credentials.
You can create both of them from Cloud Formation template, refer file cf.yaml

Make sure your AWS environment is correct so your application is able to retrieve the secret from AWS Secrets Manager

Configuration

Change in application.yml rds-endpoint and secret-name (RDSSecretsDemo if use my CloudFormation template)

spring:
  datasource:
    url: jdbc-secretsmanager:mysql://<rds-endpoint>:3306/aws
    username: <secret-name>

#spring:

datasource:

url: jdbc-secretsmanager:postgresq://:5432/aws

username:

driver-class-name: com.amazonaws.secretsmanager.sql.AWSSecretsManagerPostgreSQLDriver

liquibase:

enabled: true

Authors

About

A sample project for using AWS RDS, Secrets and AWS Secrets Manager JDBC Library


Languages

Language:Java 100.0%