Config: making [aws][external_id] part of env (#72062)

* Config: making [aws][external_id] part of env

* Fix go.sum

* Add a test
This commit is contained in:
Sarah Zinger
2023-08-04 16:06:01 -04:00
committed by GitHub
parent 306e7bfa89
commit deeb1d85f8
7 changed files with 30 additions and 2 deletions
+6
View File
@@ -289,6 +289,7 @@ type Cfg struct {
AWSAllowedAuthProviders []string
AWSAssumeRoleEnabled bool
AWSListMetricsPageLimit int
AWSExternalId string
// Azure Cloud settings
Azure *azsettings.AzureSettings
@@ -1300,6 +1301,11 @@ func (cfg *Cfg) handleAWSConfig() {
if err != nil {
cfg.Logger.Error(fmt.Sprintf("could not set environment variable '%s'", awsds.AllowedAuthProvidersEnvVarKeyName), err)
}
cfg.AWSExternalId = awsPluginSec.Key("external_id").Value()
if err != nil {
cfg.Logger.Error(fmt.Sprintf("could not set environment variable '%s'", awsds.GrafanaAssumeRoleExternalIdKeyName), err)
}
}
func (cfg *Cfg) readSessionConfig() {