You can monitor your estimated AWS charges by using Amazon CloudWatch and Cost
Explorer.

This aws `billing` metricset collects metrics both from Cloudwatch and cost
explorer for monitoring purposes.

[float]
=== AWS Permissions
Some specific AWS permissions are required for IAM user to collect estimated
billing metrics.
----
cloudwatch:GetMetricData
cloudwatch:ListMetrics
tag:getResources
sts:GetCallerIdentity
iam:ListAccountAliases
ce:GetCostAndUsage
----

[float]
=== Dashboard

The aws billing metricset comes with a predefined dashboard. For example:

image::./images/metricbeat-aws-billing-overview.png[]

[float]
=== Configuration example
[source,yaml]
----
- module: aws
  period: 24h
  metricsets:
    - billing
  credential_profile_name: elastic-beats
  cost_explorer_config:
    group_by_dimension_keys:
      - "AZ"
      - "INSTANCE_TYPE"
      - "SERVICE"
    group_by_tag_keys:
      - "aws:createdBy"
----

[float]
=== Metricset-specific configuration notes
When querying AWS Cost Explorer API, you can group AWS costs using up to two
different groups, either dimensions, tag keys, or both. Right now we support
group by type dimension and type tag with separate config parameters:

* *group_by_dimension_keys*: A list of keys used in Cost Explorer to group by
dimensions. Valid values are AZ, INSTANCE_TYPE, LEGAL_ENTITY_NAME,
LINKED_ACCOUNT, OPERATION, PLATFORM, PURCHASE_TYPE, SERVICE, TAGS, TENANCY, and
USAGE_TYPE.

* *group_by_tag_keys*: A list of keys used in Cost Explorer to group by tags.
