Skip to content

Commit

Permalink
Merge pull request #29 from envato/andrewjhumphrey-force-us-east-1-fo…
Browse files Browse the repository at this point in the history
…r-resource-fetches

Work around the resourcegroupsapi being broken if called outside us-east-1
  • Loading branch information
andrewjhumphrey authored Sep 7, 2022
2 parents 6c29137 + acee778 commit 5fdf22c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion iamy/resourcegroupstagging.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package iamy
import (
"log"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi"
"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/resourcegroupstaggingapiiface"
Expand All @@ -13,8 +14,9 @@ type resourceGroupsTaggingAPIClient struct {
}

func newResourceGroupsTaggingAPIClient(sess *session.Session) *resourceGroupsTaggingAPIClient {
// Force us of us-east-1 otherwise tags will not be returned for global resources
return &resourceGroupsTaggingAPIClient{
resourcegroupstaggingapi.New(sess),
resourcegroupstaggingapi.New(sess, aws.NewConfig().WithRegion("us-east-1")),
}
}

Expand Down

0 comments on commit 5fdf22c

Please sign in to comment.