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

Idea: Add support for IAM Auth on Role #42

Open
igorlg opened this issue Feb 26, 2025 · 2 comments
Open

Idea: Add support for IAM Auth on Role #42

igorlg opened this issue Feb 26, 2025 · 2 comments

Comments

@igorlg
Copy link

igorlg commented Feb 26, 2025

First, just wanted to say how much I appreciate this construct! It saved me MANY hours to automate database management tasks in CDK!

I'd like to share a proposal: add support for enabling IAM Authentication on the Role construct (for clusters that have it enabled), as an alternative to username/password. E.g.:

const role = new Role(this, "Role", {
    provider: provider,
    roleName: "myrole",
    enableIamAuth: true,
}

In this case, Role would either not create a secret, or create one without a password field. Another option (to keep the Role construct simple / consistent) would be to create a separate RoleWithIAM construct.

In practice, the SQL statements in Role and Provider for PostgreSQL and MySQL would have to be amended as per the RDS IAM documentation.

Happy to provide this as a PR for discussion.

@berenddeboer
Copy link
Owner

Love it, great idea! I haven't really used IAM, as I was never sure how the permissions really worked, but happy to see a PR. Probably very hard to write a test for I assume? So may need some mocking.

@igorlg
Copy link
Author

igorlg commented Mar 4, 2025

Great to hear! Yes, mocking will be needed for tests. I'll work on it over the weekend and raise a PR for consideration! Thank you!

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

No branches or pull requests

2 participants