88 "github.com/aws/aws-sdk-go-v2/config"
99 "github.com/aws/aws-sdk-go-v2/feature/s3/manager"
1010 "github.com/aws/aws-sdk-go-v2/service/s3"
11- "github.com/aws/aws-sdk-go-v2/service/sts"
1211)
1312
1413var uploader * manager.Uploader
@@ -18,6 +17,7 @@ func init() {
1817 if ! found {
1918 awsRegion = os .Getenv ("AWS_REGION" )
2019 }
20+ fmt .Println ("awsRegion:-->" , awsRegion )
2121
2222 // Load AWS default config with region
2323 cfg , err := config .LoadDefaultConfig (context .TODO (),
@@ -26,26 +26,13 @@ func init() {
2626 if err != nil {
2727 panic ("unable to load AWS SDK config, " + err .Error ())
2828 }
29+ fmt .Printf ("CFG --> %+v\n " , cfg )
2930
3031 // Create S3 client
3132 s3Client := s3 .NewFromConfig (cfg )
3233
3334 // Create uploader
3435 uploader = manager .NewUploader (s3Client )
35-
36- // Create STS client to get account ID
37- stsClient := sts .NewFromConfig (cfg )
38- // Get caller identity
39- identity , err := stsClient .GetCallerIdentity (context .TODO (), & sts.GetCallerIdentityInput {})
40- if err != nil {
41- panic ("unable to get AWS caller identity: " + err .Error ())
42- }
43-
44- // Print complete identity
45- fmt .Println ("AWS Caller Identity:" )
46- fmt .Println ("Account ID:" , * identity .Account )
47- fmt .Println ("ARN :" , * identity .Arn )
48- fmt .Println ("UserID :" , * identity .UserId )
4936}
5037
5138// UploadToS3 sends data to S3
0 commit comments