Explorar el Código

fix ooc costs w/ masterpayer

Ajay Tripathy hace 6 años
padre
commit
51d1f9908d
Se han modificado 1 ficheros con 7 adiciones y 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