---
title: Validate AWS CCM config
description: Validate a Cloud Cost Management config for an AWS account using Cost and Usage Report (CUR) 2.0 against Datadog's ingest requirements without persisting…
breadcrumbs: Docs > API > Validate AWS CCM config
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/llms.txt).

# Validate AWS CCM config

## v2 (latest)

{% alert level="warning" %}
**Note**: This endpoint is in Preview and may be subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help.md).
{% /alert %}

| Datadog site      | API endpoint                                                                  |
| ----------------- | ----------------------------------------------------------------------------- |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/integration/aws/validate_ccm_config     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/integration/aws/validate_ccm_config |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/integration/aws/validate_ccm_config |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/integration/aws/validate_ccm_config      |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/integration/aws/validate_ccm_config |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/integration/aws/validate_ccm_config |
| uk1.datadoghq.com | POST https://api.uk1.datadoghq.com/api/v2/integration/aws/validate_ccm_config |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/integration/aws/validate_ccm_config      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/integration/aws/validate_ccm_config  |

### Overview

Validate a Cloud Cost Management config for an AWS account using Cost and Usage Report
(CUR) 2.0 against Datadog's ingest requirements without persisting it.

This endpoint requires any of the following permissions:

- `cloud_cost_management_read`
- `cloud_cost_management_write`

### Request

#### Body Data (required)

Validate a Cloud Cost Management config for an AWS account integration config.

{% tabs %}
{% tab label="Model" %}
| Parent field | Field                      | Type   | Description                                                                                                              |
| ------------ | -------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------ |
|              | data [*required*]          | object | AWS CCM config validation request data.                                                                                  |
| data         | attributes [*required*]    | object | Attributes for an AWS CCM config validation request.                                                                     |
| attributes   | account_id [*required*]    | string | Your AWS Account ID without dashes.                                                                                      |
| attributes   | bucket_name [*required*]   | string | Name of the S3 bucket where the Cost and Usage Report is stored.                                                         |
| attributes   | bucket_region [*required*] | string | AWS region of the S3 bucket.                                                                                             |
| attributes   | report_name [*required*]   | string | Name of the Cost and Usage Report.                                                                                       |
| attributes   | report_prefix              | string | S3 prefix where the Cost and Usage Report is stored.                                                                     |
| data         | type [*required*]          | enum   | AWS CCM config validation resource type. Allowed enum values: `ccm_config_validation`. Default: `ccm_config_validation`. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "account_id": "123456789012",
      "bucket_name": "billing",
      "bucket_region": "us-east-1",
      "report_name": "cost-and-usage-report",
      "report_prefix": "reports"
    },
    "type": "ccm_config_validation"
  }
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="200" %}
AWS CCM Config validation result

{% tabs %}
{% tab label="Model" %}
AWS CCM config validation response body.

| Parent field | Field                    | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------ | ------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]        | object   | AWS CCM config validation response data.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| data         | attributes [*required*]  | object   | Attributes for an AWS CCM config validation response.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| attributes   | account_id [*required*]  | string   | Your AWS Account ID without dashes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| attributes   | issues [*required*]      | [object] | List of validation issues found for the Cost and Usage Report (CUR) 2.0 configuration. Empty when the configuration is valid.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| issues       | code [*required*]        | enum     | Identifies the specific reason a Cost and Usage Report (CUR) 2.0 configuration failed validation. Allowed enum values: `ISSUE_CODE_UNSPECIFIED`, `CREDENTIAL_ERROR`, `BUCKET_NAME_INVALID_GOVCLOUD`, `S3_LIST_PERMISSION_MISSING`, `S3_GET_PERMISSION_MISSING`, `S3_BUCKET_REGION_MISMATCH`, `S3_BUCKET_NOT_ACCESSIBLE`, `EXPORT_LIST_PERMISSION_MISSING`, `EXPORT_GET_PERMISSION_MISSING`, `EXPORT_NOT_FOUND`, `EXPORT_STATUS_UNHEALTHY`, `TIME_GRANULARITY_INVALID`, `FILE_FORMAT_INVALID`, `INCLUDE_RESOURCES_DISABLED`, `REFRESH_CADENCE_INVALID`, `OVERWRITE_MODE_INVALID`, `QUERY_STATEMENT_INVALID`. |
| issues       | description [*required*] | string   | Human-readable description of the validation issue.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| data         | id [*required*]          | string   | AWS CCM config validation resource identifier.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| data         | type [*required*]        | enum     | AWS CCM config validation resource type. Allowed enum values: `ccm_config_validation`. Default: `ccm_config_validation`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "account_id": "123456789012",
      "issues": [
        {
          "code": "EXPORT_NOT_FOUND",
          "description": "no CUR 2.0 export named \"cost-and-usage-report\" found"
        }
      ]
    },
    "id": "ccm_config_validation",
    "type": "ccm_config_validation"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="503" %}
Service Unavailable

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/integration/aws/validate_ccm_config" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "account_id": "123456789012",
      "bucket_name": "billing",
      "bucket_region": "us-east-1",
      "report_name": "cost-and-usage-report",
      "report_prefix": "reports"
    },
    "type": "ccm_config_validation"
  }
}
EOF
```
{% /tab %}

{% tab label="Go" %}
```go
// Validate AWS CCM config returns "AWS CCM Config validation result" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	body := datadogV2.AWSCcmConfigValidationRequest{
		Data: datadogV2.AWSCcmConfigValidationRequestData{
			Attributes: datadogV2.AWSCcmConfigValidationRequestAttributes{
				AccountId:    "123456789012",
				BucketName:   "billing",
				BucketRegion: "us-east-1",
				ReportName:   "cost-and-usage-report",
				ReportPrefix: datadog.PtrString("reports"),
			},
			Type: datadogV2.AWSCCMCONFIGVALIDATIONTYPE_CCM_CONFIG_VALIDATION,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ValidateAWSCCMConfig", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewAWSIntegrationApi(apiClient)
	resp, r, err := api.ValidateAWSCCMConfig(ctx, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AWSIntegrationApi.ValidateAWSCCMConfig`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `AWSIntegrationApi.ValidateAWSCCMConfig`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"
```
{% /tab %}

{% tab label="Java" %}
```java
// Validate AWS CCM config returns "AWS CCM Config validation result" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.AwsIntegrationApi;
import com.datadog.api.client.v2.model.AWSCcmConfigValidationRequest;
import com.datadog.api.client.v2.model.AWSCcmConfigValidationRequestAttributes;
import com.datadog.api.client.v2.model.AWSCcmConfigValidationRequestData;
import com.datadog.api.client.v2.model.AWSCcmConfigValidationResponse;
import com.datadog.api.client.v2.model.AWSCcmConfigValidationType;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
    defaultClient.setUnstableOperationEnabled("v2.validateAWSCCMConfig", true);
    AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient);

    AWSCcmConfigValidationRequest body =
        new AWSCcmConfigValidationRequest()
            .data(
                new AWSCcmConfigValidationRequestData()
                    .attributes(
                        new AWSCcmConfigValidationRequestAttributes()
                            .accountId("123456789012")
                            .bucketName("billing")
                            .bucketRegion("us-east-1")
                            .reportName("cost-and-usage-report")
                            .reportPrefix("reports"))
                    .type(AWSCcmConfigValidationType.CCM_CONFIG_VALIDATION));

    try {
      AWSCcmConfigValidationResponse result = apiInstance.validateAWSCCMConfig(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AwsIntegrationApi#validateAWSCCMConfig");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"
```
{% /tab %}

{% tab label="Python" %}
```python
"""
Validate AWS CCM config returns "AWS CCM Config validation result" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.aws_integration_api import AWSIntegrationApi
from datadog_api_client.v2.model.aws_ccm_config_validation_request import AWSCcmConfigValidationRequest
from datadog_api_client.v2.model.aws_ccm_config_validation_request_attributes import (
    AWSCcmConfigValidationRequestAttributes,
)
from datadog_api_client.v2.model.aws_ccm_config_validation_request_data import AWSCcmConfigValidationRequestData
from datadog_api_client.v2.model.aws_ccm_config_validation_type import AWSCcmConfigValidationType

body = AWSCcmConfigValidationRequest(
    data=AWSCcmConfigValidationRequestData(
        attributes=AWSCcmConfigValidationRequestAttributes(
            account_id="123456789012",
            bucket_name="billing",
            bucket_region="us-east-1",
            report_name="cost-and-usage-report",
            report_prefix="reports",
        ),
        type=AWSCcmConfigValidationType.CCM_CONFIG_VALIDATION,
    ),
)

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
configuration.unstable_operations["validate_awsccm_config"] = True
with ApiClient(configuration) as api_client:
    api_instance = AWSIntegrationApi(api_client)
    response = api_instance.validate_awsccm_config(body=body)

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"
```
{% /tab %}

{% tab label="Ruby" %}
```ruby
# Validate AWS CCM config returns "AWS CCM Config validation result" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.access_token = ENV["DD_BEARER_TOKEN"]
  config.unstable_operations["v2.validate_awsccm_config".to_sym] = true
end
api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new

body = DatadogAPIClient::V2::AWSCcmConfigValidationRequest.new({
  data: DatadogAPIClient::V2::AWSCcmConfigValidationRequestData.new({
    attributes: DatadogAPIClient::V2::AWSCcmConfigValidationRequestAttributes.new({
      account_id: "123456789012",
      bucket_name: "billing",
      bucket_region: "us-east-1",
      report_name: "cost-and-usage-report",
      report_prefix: "reports",
    }),
    type: DatadogAPIClient::V2::AWSCcmConfigValidationType::CCM_CONFIG_VALIDATION,
  }),
})
p api_instance.validate_awsccm_config(body)
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"
```
{% /tab %}

{% tab label="Rust" %}
```rust
// Validate AWS CCM config returns "AWS CCM Config validation result" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV2::model::AWSCcmConfigValidationRequest;
use datadog_api_client::datadogV2::model::AWSCcmConfigValidationRequestAttributes;
use datadog_api_client::datadogV2::model::AWSCcmConfigValidationRequestData;
use datadog_api_client::datadogV2::model::AWSCcmConfigValidationType;

#[tokio::main]
async fn main() {
    let body = AWSCcmConfigValidationRequest::new(AWSCcmConfigValidationRequestData::new(
        AWSCcmConfigValidationRequestAttributes::new(
            "123456789012".to_string(),
            "billing".to_string(),
            "us-east-1".to_string(),
            "cost-and-usage-report".to_string(),
        )
        .report_prefix("reports".to_string()),
        AWSCcmConfigValidationType::CCM_CONFIG_VALIDATION,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.validate_awsccm_config", true);
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.validate_awsccm_config(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
```
{% /tab %}

{% tab label="TypeScript" %}
```typescript
/**
 * Validate AWS CCM config returns "AWS CCM Config validation result" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration({
  authMethods: {
    AuthZ: {
      accessToken: process.env.DD_BEARER_TOKEN as string,
    },
  },
});
configuration.unstableOperations["v2.validateAWSCCMConfig"] = true;
const apiInstance = new v2.AWSIntegrationApi(configuration);

const params: v2.AWSIntegrationApiValidateAWSCCMConfigRequest = {
  body: {
    data: {
      attributes: {
        accountId: "123456789012",
        bucketName: "billing",
        bucketRegion: "us-east-1",
        reportName: "cost-and-usage-report",
        reportPrefix: "reports",
      },
      type: "ccm_config_validation",
    },
  },
};

apiInstance
  .validateAWSCCMConfig(params)
  .then((data: v2.AWSCcmConfigValidationResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"
```
{% /tab %}
{% /tabs %}
