---
title: AWS Integration Billing
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > Account Management > Billing > AWS Integration Billing
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# AWS Integration Billing

## Overview{% #overview %}

Datadog bills for AWS hosts running the Datadog Agent and all EC2 instances picked up by the Datadog-AWS integration. **You are not billed twice** if you are running the Agent on an EC2 instance picked up by the AWS integration.

**IMPORTANT**: Datadog uses EC2 instance metadata to avoid billing you twice for hosts that both run the Agent and are crawled by the AWS integration. If your EC2 instances require [Instance Metadata Service Version 2 (IMDSv2)](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html) instead of IMDSv1, do one of the following to prevent double-billing:

- Use Agent version `7.64.0` or above
- Set the parameter `ec2_prefer_imdsv2` to `true` in your [Agent configuration](https://docs.datadoghq.com/agent/configuration/agent-configuration-files.md)

When you set up the Fargate and Lambda integration tiles, and any custom metrics, it impacts your Datadog bill.

Other AWS resources such as ELB, RDS, and DynamoDB are not part of monthly infrastructure billing, and configuration exclusions do not apply.

## AWS resource exclusion{% #aws-resource-exclusion %}

You can limit the AWS metrics collected for some services to specific resources. On the [Datadog-AWS integration page](https://app.datadoghq.com/integrations/amazon-web-services), select the AWS account and click the Metric Collection tab. Under Limit Metric Collection to Specific Resources, select an AWS service and a resource type. Then, enter a filter expression based on the custom tags set on those resources. Select `* (all resource types)` to apply a filter to every resource type of that service. Resources that don't match a filter for their service don't send metrics.

In a filter expression, join tags with `AND` or `OR`, exclude with `!`, group with parentheses, and use `*` or `?` as wildcards. For example: `env:prod AND team:web`.

**Note**: If using exclusion notation (`!`), verify that the resource doesn't have the specified tag.

{% image
   source="https://docs.dd-static.net/images/account_management/billing/aws-resource-exclusion.6c667afa88485f60202fcdabaf164793.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/account_management/billing/aws-resource-exclusion.6c667afa88485f60202fcdabaf164793.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="The Metric Collection tab of an AWS account in the Datadog AWS integration page, showing the option to limit metric collection to specific resources by selecting an AWS service, a resource type, and a filter expression." /%}

You can also limit AWS metrics with the [v2 AWS Integration API](https://docs.datadoghq.com/api/latest/aws-integration.md) using the `resource_type_tag_filters` field. For details on how resource-type filtering replaces namespace-based filtering, see [Changes to AWS Metric Tag Filtering](https://docs.datadoghq.com/integrations/guide/aws-tag-filtering-by-resource-type.md).

**Note**: Only EC2 (hosts), Lambda (active functions), CloudWatch Custom Metrics (custom metrics), and [containers](https://docs.datadoghq.com/account_management/billing/containers.md) are billable by Datadog. Metrics integrated for the other services you can filter do not incur Datadog charges.

### EC2{% #ec2 %}

To filter EC2 metrics, select `ec2` as the AWS service and either `instance` or `* (all resource types)` as the resource type, then enter your filter expression. For EC2, both options apply to the same resources: EC2 instances and the EBS volumes attached to them. EBS volumes can't be selected as a separate resource type.

{% image
   source="https://docs.dd-static.net/images/account_management/billing/aws-resource-exclusion-ec2.b1c550f36651977963891d813b528a7b.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/account_management/billing/aws-resource-exclusion-ec2.b1c550f36651977963891d813b528a7b.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="An AWS resource filter with ec2 selected as the AWS service, instance as the resource type, and the filter expression env:prod AND team:web." /%}

When you add limits to an existing AWS account, previously discovered instances can stay in the [Infrastructure List](https://docs.datadoghq.com/infrastructure.md) for up to two hours. During the transition period, EC2 instances display a status of `???`. Instances with the `???` status don't count toward your billing.

Hosts with a running Agent still display and are included in billing. Use an EC2 filter to restrict `aws.ec2.*` metrics collection from AWS and to limit which EC2 instances the AWS integration reports as hosts.

#### Examples{% #examples %}

The following filter excludes all EC2 instances that contain the tag `datadog:no`:

```
!datadog:no
```

The following filter only collects metrics from EC2 instances that contain both the `env:prod` and `team:web` tags:

```
env:prod AND team:web
```

The following filter *only* collects metrics from EC2 instances tagged `datadog:monitored`, `env:production`, **or** `instance-type:c1.*`, **and not** `region:us-east-1`:

```
(datadog:monitored OR env:production OR instance-type:c1.*) AND !region:us-east-1
```

**Note**: In Datadog, uppercase letters are changed to lowercase letters and spaces are replaced with underscores. For example, to collect metrics from EC2 instances with the tag `Team:Frontend App`, in Datadog, the tag applied should be `team:frontend_app`.

### CloudWatch Metric Streams with Amazon Data Firehose{% #cloudwatch-metric-streams-with-amazon-data-firehose %}

You can optionally [send CloudWatch metrics to Datadog using CloudWatch Metric Streams and Amazon Data Firehose](https://docs.datadoghq.com/integrations/guide/aws-cloudwatch-metric-streams-with-kinesis-data-firehose.md?tab=cloudformation#streaming-vs-polling) instead of using the default API polling method. Tag filtering configured in the AWS Integration tile **also applies** to CloudWatch Metric Streams.

## Check if a host is monitored by the Agent or AWS{% #check-if-a-host-is-monitored-by-the-agent-or-aws %}

In the Infrastructure Host list:

- **Monitored by AWS Integration**

If a host displays only the AWS logo, or if its metrics are limited to the `aws.*` namespace, it indicates that the host is monitored exclusively through the AWS integration.

  {% image
     source="https://docs.dd-static.net/images/account_management/billing/infra-aws.653bb0e5b5a1abfc8db2eeb7533a259e.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/account_management/billing/infra-aws.653bb0e5b5a1abfc8db2eeb7533a259e.png?auto=format&fit=max&w=850&dpr=2 2x"
     alt="Infrastructure Host list showing multiple hosts with only the AWS logo, indicating monitoring through the AWS integration." /%}

- **Monitored by the Datadog Agent**

If a host displays the Datadog Agent logo but not the AWS logo, or if its metrics are collected from the Datadog Agent (such as `datadog.*`, `system.*`, etc.), it indicates that the host is being monitored by the Datadog Agent.

  {% image
     source="https://docs.dd-static.net/images/account_management/billing/infra-agent.f0400a010ddf5616bf8c7f3428154126.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/account_management/billing/infra-agent.f0400a010ddf5616bf8c7f3428154126.png?auto=format&fit=max&w=850&dpr=2 2x"
     alt="Infrastructure Host List showing a host with the Datadog Agent logo but no AWS logo, indicating monitoring through the Datadog Agent." /%}

## Troubleshooting{% #troubleshooting %}

For technical questions, contact [Datadog support](https://docs.datadoghq.com/help/).

For billing questions, contact your [Customer Success](mailto:success@datadoghq.com) Manager.
