From 68e54595b2dfaff5a2b22a315aeefdbf567f59de Mon Sep 17 00:00:00 2001 From: Erik Kristensen Date: Fri, 23 Feb 2024 16:22:58 -0700 Subject: [PATCH] fix(resource/ecrpublicrepository): only run if region is us-east-1 (#94) --- resources/ecr-public-repository.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/ecr-public-repository.go b/resources/ecr-public-repository.go index b26bb878..865551e5 100644 --- a/resources/ecr-public-repository.go +++ b/resources/ecr-public-repository.go @@ -2,6 +2,7 @@ package resources import ( "context" + "github.com/aws/aws-sdk-go/aws/endpoints" "time" @@ -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), }