Skip to content

Commit 8e4bf69

Browse files
committed
Print the current and bucket regions
1 parent a75e93a commit 8e4bf69

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

s3secrets-helper/s3/s3.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package s3
22

33
import (
4+
"fmt"
45
"io/ioutil"
56
"os"
67

@@ -37,12 +38,16 @@ func New(bucket string) (*Client, error) {
3738
currentRegion = "us-east-1"
3839
}
3940

41+
fmt.Printf("Discovered current region as %q\n", currentRegion)
42+
4043
// Using the current region (or a guess) find where the bucket lives
4144
bucketRegion, err := s3manager.GetBucketRegion(aws.BackgroundContext(), sess, bucket, currentRegion)
4245
if err != nil {
4346
return nil, err
4447
}
4548

49+
fmt.Printf("Discovered bucket region as %q\n", bucketRegion)
50+
4651
sess, err = session.NewSession(&aws.Config{
4752
Region: &bucketRegion,
4853
})

0 commit comments

Comments
 (0)