Beats: [Metricbeat] Unable to get account id in China regions

Created on 29 May 2020  Â·  2Comments  Â·  Source: elastic/beats

  • Version: Metricbeat 7.7.0
  • Operating System: Amazon Linux 2.0
  • Discuss Forum URL: already confirmed the issue in elastic/beats#16263 @kaiyan-sheng
  • Steps to Reproduce: using AWS credentials in China regions to run metricbeat

The hardcoded region here "us-east-1" works well in global regions but not for China regions.

x-pack/metricbeat/module/aws/aws.go
@@ -86,7 +87,9 @@ func NewMetricSet(base mb.BaseMetricSet) (*MetricSet, error) {
    }

    // Get IAM account name
    svcIam := iam.New(awsConfig)
    awsConfig.Region = "us-east-1"

Furthermore, I have changed "us-east-1" to "cn-north-1" and re-compiled in both China regions: Beijing and Ningxia, it works well.

So, i would suggest to add a new variable to configure by users.

Platforms enhancement

Most helpful comment

Is there any progress on this issue ?

A config param aws_partition could indicate the aws account type.

https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html

The following are the supported partitions:

aws - AWS Regions

aws-cn - AWS China Regions

aws-us-gov - AWS GovCloud (US) Regions

All 2 comments

Pinging @elastic/integrations-platforms (Team:Platforms)

Is there any progress on this issue ?

A config param aws_partition could indicate the aws account type.

https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html

The following are the supported partitions:

aws - AWS Regions

aws-cn - AWS China Regions

aws-us-gov - AWS GovCloud (US) Regions
Was this page helpful?
0 / 5 - 0 ratings