14722 - removing unnecessary arn check that breaks assume role feature in other AWS partitions

pull/14746/head
jaken551 6 years ago
parent 0affb23cb1
commit 64163f0198
  1. 3
      pkg/tsdb/cloudwatch/credentials.go

@ -3,7 +3,6 @@ package cloudwatch
import ( import (
"fmt" "fmt"
"os" "os"
"strings"
"sync" "sync"
"time" "time"
@ -43,7 +42,7 @@ func GetCredentials(dsInfo *DatasourceInfo) (*credentials.Credentials, error) {
secretAccessKey := "" secretAccessKey := ""
sessionToken := "" sessionToken := ""
var expiration *time.Time = nil var expiration *time.Time = nil
if dsInfo.AuthType == "arn" && strings.Index(dsInfo.AssumeRoleArn, "arn:aws:iam:") == 0 { if dsInfo.AuthType == "arn" {
params := &sts.AssumeRoleInput{ params := &sts.AssumeRoleInput{
RoleArn: aws.String(dsInfo.AssumeRoleArn), RoleArn: aws.String(dsInfo.AssumeRoleArn),
RoleSessionName: aws.String("GrafanaSession"), RoleSessionName: aws.String("GrafanaSession"),

Loading…
Cancel
Save