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

Support AWS RDS IAM Authentication for Redash database #7302

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

winebarrel
Copy link
Contributor

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • New Query Runner (Data Source)
  • New Alert Destination
  • Other

Description

If you are using AWS RDS as your Redash database, enable IAM authentication.
Setting environment variable REDASH_DATABASE_IAM_AUTH to true enables IAM authentication

How is this tested?

  • Unit tests (pytest, jest)
  • E2E Tests (Cypress)
  • Manually
  • N/A

I created a PostgreSQL (Aurora) instance on AWS RDS and confirmed that I can connect to the DB using IAM authentication from Redash in docker compose with the following settings.:

REDASH_DATABASE_URL=postgresql://[email protected]:5432/postgres
AWS_ACCESS_KEY_ID=xxx
AWS_SECRET_ACCESS_KEY=xxx
AWS_DEFAULT_REGION=ap-northeast-1
REDASH_DATABASE_IAM_AUTH=true

redash role used to connect is granted rds_iam role.

postgres=> SELECT r.rolname as username,r1.rolname as "role"
postgres-> FROM pg_catalog.pg_roles r JOIN pg_catalog.pg_auth_members m
postgres-> ON (m.member = r.oid)
postgres-> JOIN pg_roles r1 ON (m.roleid=r1.oid)
postgres-> WHERE r.rolcanlogin
postgres-> ORDER BY 1;
 username |     role
----------+---------------
 postgres | rds_superuser
 redash   | rds_superuser
 redash   | rds_iam

Related Tickets & Documents

N/A

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

N/A

@winebarrel winebarrel force-pushed the support-aws-rds-iam-auth branch 3 times, most recently from fff9775 to e6e0d6a Compare January 31, 2025 17:09
@winebarrel winebarrel marked this pull request as ready for review January 31, 2025 17:16
@winebarrel winebarrel force-pushed the support-aws-rds-iam-auth branch 3 times, most recently from 654137a to 9596ae5 Compare January 31, 2025 17:22
@winebarrel winebarrel force-pushed the support-aws-rds-iam-auth branch from 9596ae5 to ab12ae6 Compare January 31, 2025 17:24
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.

1 participant