Explorar o código

Merge pull request #532 from kubecost/AjayTripathy-fix-ooc-masterpayer

Ajay tripathy fix ooc masterpayer
Ajay Tripathy %!s(int64=5) %!d(string=hai) anos
pai
achega
55b013e634
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      pkg/cloud/awsprovider.go

+ 7 - 0
pkg/cloud/awsprovider.go

@@ -1770,6 +1770,13 @@ func (a *AWS) ExternalAllocations(start string, end string, aggregators []string
 	}
 	s := session.Must(session.NewSession(c))
 	svc := athena.New(s)
+	if customPricing.MasterPayerARN != "" {
+		creds := stscreds.NewCredentials(s, customPricing.MasterPayerARN)
+		svc = athena.New(s, &aws.Config{
+			Region:      region,
+			Credentials: creds,
+		})
+	}
 
 	var e athena.StartQueryExecutionInput