Retrieve password of RDS Postgres DB through IAM from GKE #4657
Unanswered
nuskyazhar
asked this question in
Q&A
Replies: 1 comment
-
|
@nuskyazhar did you ever figure out how to do this? I am trying to do something similar. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to connect a Spring Boot application running on GKE to a AWS RDS Postgres DB through IAM federation
Therefore, I am trying to create a custom
HikariDataSourcewhich overrides thegetPasswordmethod - so the application can use this password to connect to the DB.I have retrieved the identity-token of for the GCP service account by impersonating it.
With this
idTokenTokenValue, I am trying to Assume a role in AWS - target is to exchange this token to a STS token and retrieve the password of the DBI am not able to build the
StsAssumeRoleWithWebIdentityCredentialsProviderbecause it requires aStsClientIf I create the
StsClientfirst, and try to provide it to theStsAssumeRoleWithWebIdentityCredentialsProvider,StsClientis trying to get credentials from theSystemPropertyCredentialsProviderwhich requiresAWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY.I can obtain the AWS access key ID and secret access key only after assuming the role or calling
resolveCredentials()on theStsAssumeRoleWithWebIdentityCredentialsProviderTherefore, it seem to have a circular dependency between
StsClientandStsAssumeRoleWithWebIdentityCredentialsProviderCould someone please advice me how to resolve this?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions