cloudquery / cq-provider-aws

CloudQuery Provider for AWS
https://cloudquery.io
Mozilla Public License 2.0
29 stars 40 forks source link

getAccountId func Region is hardcode in V0.11.6 #917

Closed ywyt738 closed 2 years ago

ywyt738 commented 2 years ago

Describe the bug

./client/client.go

func getAccountId(ctx context.Context, awsCfg aws.Config) (*sts.GetCallerIdentityOutput, error) {
    svc := sts.NewFromConfig(awsCfg)
    return svc.GetCallerIdentity(ctx, &sts.GetCallerIdentityInput{}, func(o *sts.Options) {
        o.Region = "aws-global"
    })

}

The o.Region should be cn-north-1 or cn-northwest-1

Expected Behavior

sts success

Steps to Reproduce

aws configure resions is ["cn-north-1"]

Possible Solution

./client/client.go

o.Region can't be hardcode in func getAccountId.

Provider and CloudQuery version

0.23.4

Additional Context

No response

bbernays commented 2 years ago

@ywyt738 Thank you for helping us out by opening these issues for bugs you find as we have no ability to use the aws-cn partition