Skip to content

Commit

Permalink
comparing sdk and cli identities
Browse files Browse the repository at this point in the history
  • Loading branch information
okankoAMZ committed Sep 21, 2023
1 parent efdf8ca commit 0aff915
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packaging/uniformBuild/uniformBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/sts"
"os"
"strings"
"time"
Expand Down Expand Up @@ -45,6 +46,17 @@ func CreateRemoteBuildManager(instanceGuide map[string]OS, accountID string) *Re
if err != nil {
return nil
}
// Use the configuration to create an STS client
svc := sts.NewFromConfig(cfg)
// Use the STS client to get the caller identity
resp, err := svc.GetCallerIdentity(context.TODO(), &sts.GetCallerIdentityInput{})
if err != nil {
panic(err)
}

// Print the caller identity
fmt.Println("User ID:", *resp.UserId)
fmt.Println("ARN:", *resp.Arn)
//instance := *GetInstanceFromID(client, "i-09fc6fdc80cd713a4")
rbm := RemoteBuildManager{}

Expand Down

0 comments on commit 0aff915

Please sign in to comment.