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
-
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
HikariDataSource
which overrides thegetPassword
method - 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
StsAssumeRoleWithWebIdentityCredentialsProvider
because it requires aStsClient
If I create the
StsClient
first, and try to provide it to theStsAssumeRoleWithWebIdentityCredentialsProvider
,StsClient
is trying to get credentials from theSystemPropertyCredentialsProvider
which 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 theStsAssumeRoleWithWebIdentityCredentialsProvider
Therefore, it seem to have a circular dependency between
StsClient
andStsAssumeRoleWithWebIdentityCredentialsProvider
Could someone please advice me how to resolve this?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions