Skip to content

Commit

Permalink
use clients from the awsservice package
Browse files Browse the repository at this point in the history
  • Loading branch information
varunch77 committed Dec 4, 2024
1 parent df7abce commit 8dcc2d4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/cloudwatchlogs/publish_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"time"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/aws-sdk-go-v2/service/ec2"
ec2Types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
Expand Down Expand Up @@ -86,8 +85,6 @@ var (
},
}
resourceNotFoundException *types.ResourceNotFoundException
cwlClient *cloudwatchlogs.Client
ec2Client *ec2.Client
)

type writeToCloudWatchTestInput struct {
Expand Down Expand Up @@ -232,7 +229,7 @@ func TestWriteLogsWithEntityInfo(t *testing.T) {
Resources: []string{instanceId},
Tags: tagsToCreate,
}
_, err := ec2Client.DeleteTags(context.TODO(), input)
_, err := awsservice.Ec2Client.DeleteTags(context.TODO(), input)
assert.NoError(t, err)
// Add a short delay to ensure tag deletion propagates
time.Sleep(5 * time.Second)
Expand All @@ -244,14 +241,14 @@ func TestWriteLogsWithEntityInfo(t *testing.T) {
InstanceId: aws.String(instanceId),
InstanceMetadataTags: ec2Types.InstanceMetadataTagsStateEnabled,
}
_, modifyErr := ec2Client.ModifyInstanceMetadataOptions(context.TODO(), modifyInput)
_, modifyErr := awsservice.Ec2Client.ModifyInstanceMetadataOptions(context.TODO(), modifyInput)
assert.NoError(t, modifyErr)

input := &ec2.CreateTagsInput{
Resources: []string{instanceId},
Tags: tagsToCreate,
}
_, createErr := ec2Client.CreateTags(context.TODO(), input)
_, createErr := awsservice.Ec2Client.CreateTags(context.TODO(), input)
assert.NoError(t, createErr)
}
id := uuid.New()
Expand Down

0 comments on commit 8dcc2d4

Please sign in to comment.