Cloudwatch: Revert aws sdk go v2 (#103644)

* Revert "CloudWatch: Import new grafana-aws-sdk with PDC fix (#103249)"

This reverts commit f2b5b4e0c0.

* Revert "CloudWatch: Migrate to aws-sdk-go-v2 (#103106)"

This reverts commit a65cc0df93.

* make update-workspace
This commit is contained in:
Isabella Siu
2025-04-08 15:40:15 -04:00
committed by GitHub
parent 27e9422f24
commit 13534a7d98
60 changed files with 1599 additions and 1483 deletions
+8 -9
View File
@@ -5,13 +5,12 @@ import (
"encoding/json"
"testing"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/cloudwatch"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudwatch"
"github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/backend/log"
"github.com/grafana/grafana/pkg/tsdb/cloudwatch/models"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -23,7 +22,7 @@ func TestQuery_AnnotationQuery(t *testing.T) {
})
var client fakeCWAnnotationsClient
NewCWClient = func(aws.Config) models.CWClient {
NewCWClient = func(sess *session.Session) cloudwatchiface.CloudWatchAPI {
return &client
}
@@ -54,8 +53,8 @@ func TestQuery_AnnotationQuery(t *testing.T) {
assert.Equal(t, &cloudwatch.DescribeAlarmsForMetricInput{
Namespace: aws.String("custom"),
MetricName: aws.String("CPUUtilization"),
Statistic: "Average",
Period: aws.Int32(300),
Statistic: aws.String("Average"),
Period: aws.Int64(300),
}, client.calls.describeAlarmsForMetric[0])
})
@@ -87,7 +86,7 @@ func TestQuery_AnnotationQuery(t *testing.T) {
require.Len(t, client.calls.describeAlarms, 1)
assert.Equal(t, &cloudwatch.DescribeAlarmsInput{
MaxRecords: aws.Int32(100),
MaxRecords: aws.Int64(100),
ActionPrefix: aws.String("some_action_prefix"),
AlarmNamePrefix: aws.String("some_alarm_name_prefix"),
}, client.calls.describeAlarms[0])