Open database connection to AWS RDS with IAM

Versión 1.0.0 (2,51 KB) por Jeff Mandel
A maven pom file to download the requisite jars to enable a connection to an AWS database
1 Descarga
Actualizado 8 mar 2025

Ver licencia

When developing a microservice that accesses an AWS RDS database, securing the connection with IAM is useful. Amazon provides a driver wrapper that adds the authentication methods, but it requires a number of jars on the classpath. This project provides a Maven pom that downloads all of these so they can be added to the static javaclasspath.
Usage:
  1. copy the file pom.xml to a directory and cd to the directory
  2. mvn dependency:copy-dependencies (This will download all of the jars to the directory target/dependency)
  3. find "$(cd target/dependency;pwd)" -type f > $(matlab -batch "fprintf('%s', fullfile(prefdir,'javaclasspath.txt'))") (This gets a listing of all files in that directory and writes it to a file. The filename is generated by calling matlab to get the prefdir location)
  4. start matlab and call openRDSdb.m, supplying credentials directly, or by specifying an AWS profile.
I've tested this on Mac and Linux. It should work on Windows if you have Maven installed and can figure out how to make step 3 work in Windows. Note that in a production environment (meaning deploying a Docker container on AWS), you should attach a policy to the service that grants the service permission to access the database, but during development using a profile is useful.

Citar como

Jeff Mandel (2025). Open database connection to AWS RDS with IAM (https://la.mathworks.com/matlabcentral/fileexchange/180330-open-database-connection-to-aws-rds-with-iam), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2024b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.0.0