Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

fix: List buckets only us-east-1 #1088

Merged
merged 2 commits into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion resources/services/s3/buckets.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,9 @@ func S3Buckets() *schema.Table {

func fetchS3Buckets(ctx context.Context, meta schema.ClientMeta, _ *schema.Resource, res chan<- interface{}) error {
svc := meta.(*client.Client).Services().S3
response, err := svc.ListBuckets(ctx, nil)
response, err := svc.ListBuckets(ctx, nil, func(options *s3.Options) {
options.Region = "us-east-1"
})
if err != nil {
return diag.WrapError(err)
}
Expand Down
2 changes: 1 addition & 1 deletion resources/services/s3/buckets_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func buildS3Buckets(t *testing.T, ctrl *gomock.Controller) client.Services {
t.Fatal(err)
}

m.EXPECT().ListBuckets(gomock.Any(), gomock.Any()).Return(
m.EXPECT().ListBuckets(gomock.Any(), gomock.Any(), gomock.Any()).Return(
&s3.ListBucketsOutput{
Buckets: []s3Types.Bucket{b},
}, nil)
Expand Down