Skip to content

Commit

Permalink
šŸ§¹ return the correct value for aws account id when connected to subreā€¦
Browse files Browse the repository at this point in the history
ā€¦source (#4566)
  • Loading branch information
vjeffrey authored Aug 19, 2024
1 parent 1c5969b commit 4622bb2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions providers/aws/resources/aws_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package resources
import (
"context"
"errors"
"strings"

"github.com/aws/aws-sdk-go-v2/service/iam"
"github.com/aws/aws-sdk-go-v2/service/organizations"
Expand Down Expand Up @@ -111,11 +110,10 @@ func initAwsAccount(runtime *plugin.Runtime, args map[string]*llx.RawData) (map[
if len(args) >= 2 {
return args, nil, nil
}

if len(args) == 0 {
if ids := getAssetIdentifier(runtime); ids != nil {
id := strings.TrimPrefix(ids.arn, "arn:aws:sts::")
args["id"] = llx.StringData(id)
}
conn := runtime.Connection.(*connection.AwsConnection)
args["id"] = llx.StringData(conn.AccountId())
}
if args["id"] == nil {
return args, nil, errors.New("no account id specified")
Expand Down

0 comments on commit 4622bb2

Please sign in to comment.