AWS: Update deprecated aws-sdk functions from env variable versions (#89643)

This commit is contained in:
Isabella Siu
2024-06-26 11:56:39 -04:00
committed by GitHub
parent 40207c53ae
commit 3ac109e759
10 changed files with 54 additions and 33 deletions
+4 -5
View File
@@ -80,7 +80,7 @@ type CloudWatchService struct {
}
type SessionCache interface {
GetSession(c awsds.SessionConfig) (*session.Session, error)
GetSessionWithAuthSettings(c awsds.GetSessionConfig, as awsds.AuthSettings) (*session.Session, error)
}
func newExecutor(im instancemgmt.InstanceManager, logger log.Logger) *cloudWatchExecutor {
@@ -299,7 +299,7 @@ func (ds *DataSource) newSession(region string) (*session.Session, error) {
}
region = ds.Settings.Region
}
sess, err := ds.sessions.GetSession(awsds.SessionConfig{
sess, err := ds.sessions.GetSessionWithAuthSettings(awsds.GetSessionConfig{
// https://github.com/grafana/grafana/issues/46365
// HTTPClient: instance.HTTPClient,
Settings: awsds.AWSDatasourceSettings{
@@ -313,9 +313,8 @@ func (ds *DataSource) newSession(region string) (*session.Session, error) {
AccessKey: ds.Settings.AccessKey,
SecretKey: ds.Settings.SecretKey,
},
UserAgentName: aws.String("Cloudwatch"),
AuthSettings: &ds.Settings.GrafanaSettings,
})
UserAgentName: aws.String("Cloudwatch")},
ds.Settings.GrafanaSettings)
if err != nil {
return nil, err
}