-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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 IAM authentication for Redshift serverless #35897
Support IAM authentication for Redshift serverless #35897
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Just small nit
conn.login, conn.password, conn.port = self.get_iam_token(conn) | ||
conn.login, conn.password, conn.port = self.get_iam_token( | ||
conn, is_serverless=conn.extra_dejson.get("is_serverless", False) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we provide entire Connection object into the get_iam_token
method, I guess we do not need to use is_serverless
argument and could resolve it into the get_iam_token
serverless_token_duration_seconds = conn.extra_dejson.get( | ||
"serverless_token_duration_seconds", 3600 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This parts also makes me sad, there is no info into the documentation about this parameter, so end users might know about this settings only if they open the source code 😿
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it a general problem, how to not forget to document some parameters from the abstract Connection Extra
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add it to the connection example, but I agree with the need for a general solution. I have some ideas but don't know if they are functional; I will try some of them and then open a discussion.
This PR adds some extra parameters to Redshift connection to support IAM authentication for AWS Redshift Serverless. When
is_serverless
extra is set toTrue
, it usesredshift-serverless
client instead ofredshift
, and provides the same param toredshift_connector.connect
to initiate serverless connection.closes: #35805