Skip to content

A deployment utility package for AWS RDS databases with asynchronous status utilities. This package acts as a utility middleware for the AWS-RDS SDK.

License

Notifications You must be signed in to change notification settings

KeithAlt/java-aws-rds-deploy-wizard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java AWS RDS Deploy Wizard

Deploy AWS RDS instances & asynchronously follow-up


Deploy an RDS database with specific details:

  RDSInstance db = new RDSInstance.Builder()
    .setDBUsername("<DB-USER-NAME>")
    .setDBPassword("<DB-USER-PASSWORD>")
    .setDBName("<DB-NAME>")
    .setDBStorage(5)
    .setDBClass("<RDS-CLASS>")
    .setDBEngine("<DATABASE-TYPE>")
    .setClient(
        "<ACCESS-KEY>",
        "<SECRET-KEY>",
        "<REGION>"
    )
    .build()
    .createDB()
    .asyncAwaitAvailable()
    .thenApply(newDB -> {
        System.out.println(newDB.getInstanceID() + "(" + newDB.getARN() + ") " + "is now available");
        // ...
        return newDB;
    }).join();

Deploy an RDS database with configured / AWS SDK defaults:

  RDSInstance db = new RDSInstance.Builder()
    .useConfigDefaults()
    .useDefaultClient()
    .build()
    .createOrConnectDB()
    .asyncAwaitAvailable()
    .thenApply(newDB -> {
        System.out.println(newDB.getInstanceID() + "(" + newDB.getARN() + ") " + "is now available");
        // ...
        return newDB;
    }).join();

Dependencies

Setup

Option 1. (Recommended)

  • Login to the AWS CLI on the desired machine (this is typically automatic on an EC2) & use the .useDefaultClient() builder for client authentication
  • Either configure the rds-config.yml file or specify manually the required builder fields (as shown above) to build your desired AWS RDS instance

Option 2.

  • Authenticate your AWS Client manually with the required builder fields as seen in .setClient()
  • Either configure the rds-config.yml file or specify manually the required builder fields (as shown above) to build your desired AWS RDS instance

Option 3.

Configure the rds-config.yml file with all the desired AWS client credentials & RDS instance build information

AWS_ACCESS_KEY: UNSET
AWS_SECRET_KEY: UNSET
AWS_REGION: UNSET

RDS_ID: UNSET
RDS_USERNAME: UNSET
RDS_PASSWORD: UNSET
RDS_TYPE: UNSET
RDS_ENGINE: UNSET
RDS_STORAGE: UNSET

EXAMPLE CONFIG:

AWS_ACCESS_KEY: AKIATMGJSDAGSAHV
AWS_SECRET_KEY: J9YFIxOhEYfnmlFNLJdfsfbfasbf
AWS_REGION: us-west-1

RDS_ID: newdatabase
RDS_USERNAME: operator
RDS_PASSWORD: ohfsadjbviabfdi8hf128
RDS_TYPE: db.t2.micro
RDS_ENGINE: postgres
RDS_STORAGE: 5

Configuring the above file is optional if you intend on using the build-setter methods shown in the first above code example to authenticate into AWS.

About

A deployment utility package for AWS RDS databases with asynchronous status utilities. This package acts as a utility middleware for the AWS-RDS SDK.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages