Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: AWS IAM auth for POSTGRES dataSource #1757

Merged

Conversation

quentin-roche
Copy link
Contributor

@quentin-roche quentin-roche commented Jan 30, 2025

Hello,

For my use case, I need Terrakube to connect to RDS. We have a strict no static password, Terrakube already supports S3 access using AWS DefaultCredentialsProvider but does not have a way to do it for dataSources.

This PR allow connecting to RDS Postgres database using the AWS IAM.

Added:

  • A custom implementation of PGSimpleDataSource.getConnection that allows pulling and refreshing AWS RDS token
  • Two new configs:
    • DatasourceAwsIamAuth (boolean, default: false): Enable pulling Postgres password using AWS IAM
    • DatasourceAwsRegion (string, default: "aws-region-not-set"): The region of the RDS
  • A new dependency on: software.amazon.awssdk > rds

Test:

  • It was tested on AWS RDS Postgres

Let me know if you want me to change things, this is my first java PR

@alfespa17
Copy link
Member

I think it looks good @quentin-roche

@alfespa17 alfespa17 merged commit ebe189e into AzBuilder:main Jan 30, 2025
3 checks passed
@alfespa17 alfespa17 changed the title Feature: AWS IAM auth for POSTGRES dataSource feat: AWS IAM auth for POSTGRES dataSource Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants