Skip to content

Commit

Permalink
fix(resource/ecrpublicrepository): only run if region is us-east-1 (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen authored Feb 23, 2024
1 parent 0915a23 commit 68e5459
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions resources/ecr-public-repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package resources

import (
"context"
"github.com/aws/aws-sdk-go/aws/endpoints"

"time"

Expand Down Expand Up @@ -36,6 +37,11 @@ func (l *ECRPublicRepositoryLister) List(_ context.Context, o interface{}) ([]re
svc := ecrpublic.New(opts.Session)
var resources []resource.Resource

// ECRPublicRepository is only supported in us-east-1, only run if the region is us-east-1
if opts.Session.Config.Region == nil || *opts.Session.Config.Region != endpoints.UsEast1RegionID {
return resources, nil
}

input := &ecrpublic.DescribeRepositoriesInput{
MaxResults: aws.Int64(100),
}
Expand Down

0 comments on commit 68e5459

Please sign in to comment.