# Aws multi account metric beat setup

**URL:** <https://discuss.elastic.co/t/aws-multi-account-metric-beat-setup/283925>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [September 11, 2021, 5:08am UTC](https://discuss.elastic.co/t/aws-multi-account-metric-beat-setup/283925 "2021-09-11T05:08:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sinto](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@sinto](https://discuss.elastic.co/u/sinto)\
**Post date:** [September 11, 2021, 5:08am UTC](https://discuss.elastic.co/t/aws-multi-account-metric-beat-setup/283925/1 "2021-09-11T05:08:17Z")

</div>

Hi Team,  
Is there any way I can achieve one metricbeat.yml configuration to fetch aws cloudwatch metrics from multiple aws account and each account need seperate indexes something like like metrics-cloud-[Account-Number/Account-Name]-Date?

---

<div class="post-metadata">

**Author:** ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)\
**Post date:** [September 11, 2021, 1:26pm UTC](https://discuss.elastic.co/t/aws-multi-account-metric-beat-setup/283925/2 "2021-09-11T13:26:06Z")

</div>

Yes u can duplicate the configs, will probably just need different keys to connect to the different accounts.

```auto
- module: aws
  period: 5m
  metricsets:
    - cloudwatch
  metrics:
    - namespace: AWS/EC2
      #name: ["CPUUtilization", "DiskWriteOps"]
      resource_type: ec2:instance
      #dimensions:
      # - name: InstanceId
      # value: i-0686946e22cf9494a
      #statistic: ["Average", "Maximum"]
  access_key_id: xxx
  secret_access_key: xxx

- module: aws
  period: 5m
  metricsets:
    - cloudwatch
  metrics:
    - namespace: AWS/EC2
      #name: ["CPUUtilization", "DiskWriteOps"]
      resource_type: ec2:instance
      #dimensions:
      # - name: InstanceId
      # value: i-0686946e22cf9494a
      #statistic: ["Average", "Maximum"]
....

```

The u can do different indices following [Configure the Elasticsearch output | Filebeat Reference [7.14] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/current/elasticsearch-output.html#indices-option-es)

---

<div class="post-metadata">

**Author:** ![sinto](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@sinto](https://discuss.elastic.co/u/sinto)\
**Post date:** [September 27, 2021, 7:20am UTC](https://discuss.elastic.co/t/aws-multi-account-metric-beat-setup/283925/3 "2021-09-27T07:20:24Z")

</div>

Thanks for providing the solution. Better to use role rather than access key to avoid hardcoding

---

<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:** [October 25, 2021, 9:20am UTC](https://discuss.elastic.co/t/aws-multi-account-metric-beat-setup/283925/4 "2021-10-25T09:20:49Z")

</div>

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