Support IAM authentication for Redshift serverless - #35897
Conversation
Taragolis
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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_serverlessextra is set toTrue, it usesredshift-serverlessclient instead ofredshift, and provides the same param toredshift_connector.connectto initiate serverless connection.closes: #35805