# Authentication in us-gov-west-1 with Metricbeat AWS module

**URL:** <https://discuss.elastic.co/t/authentication-in-us-gov-west-1-with-metricbeat-aws-module/254951>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [November 10, 2020, 4:36pm UTC](https://discuss.elastic.co/t/authentication-in-us-gov-west-1-with-metricbeat-aws-module/254951 "2020-11-10T16:36:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jstein\_presidio](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jstein\_presidio](https://discuss.elastic.co/u/jstein_presidio)\
**Post date:** [November 10, 2020, 4:36pm UTC](https://discuss.elastic.co/t/authentication-in-us-gov-west-1-with-metricbeat-aws-module/254951/1 "2020-11-10T16:36:45Z")

</div>

aws.yml is as follows

```auto
  regions: us-gov-west-1
  shared_credential_file: /mnt/home/metricbeat/.aws_creds
  aws_partition: aws-us-gov
  #endpoint: us-gov-west-1.amazonaws.com
  period: 5m
  metricsets:
    - ec2

```

`2020-11-10T10:54:06.259-0500 WARN [aws.ec2] aws/aws.go:114 failed to get caller identity, please check permission setting: RequestError: send request failed caused by: Post "https://sts.us-gov-east-1.amazonaws.com/": dial tcp 52.46.100.6:443: connect: connection timed out`

The timeout error is because this is running in us-gov-west-1 and doesn't have access to us-gov-east-1  
If I uncomment the endpoint config and run with region hardcoded in there is a different error where it tries to look up iam creds against [iam.us-gov-west-1.amazon.aws.com](http://iam.us-gov-west-1.amazon.aws.com). The reason seams to be because iam is global and follows a different pattern with the url of [us-gov.amazon.aws.com](http://us-gov.amazon.aws.com).

I think the issue here maybe that aws\_partition defaults to us-gov-east-1 when set to aws-us-gov and has no way to be explicitly set, except by globally overriding with the endpoint parameter which appears break things in other ways.

---

<div class="post-metadata">

**Author:** ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)\
**Post date:** [November 10, 2020, 11:20pm UTC](https://discuss.elastic.co/t/authentication-in-us-gov-west-1-with-metricbeat-aws-module/254951/2 "2020-11-10T23:20:50Z")

</div>

Hello! Thanks for reporting this! This definitely looks like a bug to me. Could you please open a github issue in Beats for this?

Thank you!!

---

<div class="post-metadata">

**Author:** ![jstein\_presidio](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jstein\_presidio](https://discuss.elastic.co/u/jstein_presidio)\
**Post date:** [November 11, 2020, 6:13pm UTC](https://discuss.elastic.co/t/authentication-in-us-gov-west-1-with-metricbeat-aws-module/254951/3 "2020-11-11T18:13:52Z")

</div>

Hey thanks for replying @Kaiyan_Sheng. I was able to resolve my issue. It turned out we were using a proxy to access aws services from within our network and the configuration above worked after including HTTP\_PROXY and NO\_PROXY environment variables to our metricbeat unit file.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 9, 2020, 8:13pm UTC](https://discuss.elastic.co/t/authentication-in-us-gov-west-1-with-metricbeat-aws-module/254951/4 "2020-12-09T20:13:56Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
