Commit a98c129d by Johannes Brück Committed by GitHub

CloudWatch: Prefer webIdentity over EC2 role also when assuming a role (#23807)

Same as #23452 but for assumed roles.
When using service accounts (webIdentity) on EKS in combination 
with assuming roles in other AWS accounts Grafana needs to retrieve 
the service account credentials first and then needs to assume the 
configured role. 
parent 80ab18f4
...@@ -60,8 +60,8 @@ func GetCredentials(dsInfo *DatasourceInfo) (*credentials.Credentials, error) { ...@@ -60,8 +60,8 @@ func GetCredentials(dsInfo *DatasourceInfo) (*credentials.Credentials, error) {
[]credentials.Provider{ []credentials.Provider{
&credentials.EnvProvider{}, &credentials.EnvProvider{},
&credentials.SharedCredentialsProvider{Filename: "", Profile: dsInfo.Profile}, &credentials.SharedCredentialsProvider{Filename: "", Profile: dsInfo.Profile},
remoteCredProvider(stsSess),
webIdentityProvider(stsSess), webIdentityProvider(stsSess),
remoteCredProvider(stsSess),
}) })
stsConfig := &aws.Config{ stsConfig := &aws.Config{
Region: aws.String(dsInfo.Region), Region: aws.String(dsInfo.Region),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment