---
title: Get an AWS integration by config ID
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > AWS Integration
---

# Get an AWS integration by config ID{% #get-an-aws-integration-by-config-id %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                                                              |
| ----------------- | ----------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/integration/aws/accounts/{aws_account_config_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/integration/aws/accounts/{aws_account_config_id}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/integration/aws/accounts/{aws_account_config_id}  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id} |

### Overview

Get an AWS Account Integration Config by config ID. This endpoint requires the `aws_configuration_read` permission.

### Arguments

#### Path Parameters

| Name                                    | Type   | Description                                                                                                                                                                                                                                                 |
| --------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| aws_account_config_id [*required*] | string | Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the [List all AWS integrations](https://docs.datadoghq.com/api/latest/aws-integration.md#list-all-aws-integrations) endpoint and query by AWS Account ID. |

### Response

{% tab title="200" %}
AWS Account object
{% tab title="Model" %}
AWS Account response body.

| Parent field      | Field                                        | Type          | Description                                                                                                                                                                                                                                                                 |
| ----------------- | -------------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                   | data [*required*]                       | object        | AWS Account response data.                                                                                                                                                                                                                                                  |
| data              | attributes                                   | object        | AWS Account response attributes.                                                                                                                                                                                                                                            |
| attributes        | account_tags                                 | [string]      | Tags to apply to all hosts and metrics reporting for this account. Defaults to `[]`.                                                                                                                                                                                        |
| attributes        | auth_config                                  |  <oneOf> | AWS Authentication config.                                                                                                                                                                                                                                                  |
| auth_config       | Option 1                                     | object        | AWS Authentication config to integrate your account using an access key pair.                                                                                                                                                                                               |
| Option 1          | access_key_id [*required*]              | string        | AWS Access Key ID.                                                                                                                                                                                                                                                          |
| Option 1          | secret_access_key                            | string        | AWS Secret Access Key.                                                                                                                                                                                                                                                      |
| auth_config       | Option 2                                     | object        | AWS Authentication config to integrate your account using an IAM role.                                                                                                                                                                                                      |
| Option 2          | external_id                                  | string        | AWS IAM External ID for associated role.                                                                                                                                                                                                                                    |
| Option 2          | role_name [*required*]                  | string        | AWS IAM Role name.                                                                                                                                                                                                                                                          |
| attributes        | aws_account_id [*required*]             | string        | AWS Account ID.                                                                                                                                                                                                                                                             |
| attributes        | aws_partition                                | enum          | AWS partition your AWS account is scoped to. Defaults to `aws`. See [Partitions](https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/partitions.html) in the AWS documentation for more information. Allowed enum values: `aws,aws-cn,aws-us-gov` |
| attributes        | aws_regions                                  |  <oneOf> | AWS Regions to collect data from. Defaults to `include_all`.                                                                                                                                                                                                                |
| aws_regions       | Option 1                                     | object        | Include all regions. Defaults to `true`.                                                                                                                                                                                                                                    |
| Option 1          | include_all [*required*]                | boolean       | Include all regions.                                                                                                                                                                                                                                                        |
| aws_regions       | Option 2                                     | object        | Include only these regions.                                                                                                                                                                                                                                                 |
| Option 2          | include_only [*required*]               | [string]      | Include only these regions.                                                                                                                                                                                                                                                 |
| attributes        | created_at                                   | date-time     | Timestamp of when the account integration was created.                                                                                                                                                                                                                      |
| attributes        | logs_config                                  | object        | AWS Logs Collection config.                                                                                                                                                                                                                                                 |
| logs_config       | lambda_forwarder                             | object        | Log Autosubscription configuration for Datadog Forwarder Lambda functions. Automatically set up triggers for existing and new logs for some services, ensuring no logs from new resources are missed and saving time spent on manual configuration.                         |
| lambda_forwarder  | lambdas                                      | [string]      | List of Datadog Lambda Log Forwarder ARNs in your AWS account. Defaults to `[]`.                                                                                                                                                                                            |
| lambda_forwarder  | log_source_config                            | object        | Log source configuration.                                                                                                                                                                                                                                                   |
| log_source_config | tag_filters                                  | [object]      | List of AWS log source tag filters. Defaults to `[]`.                                                                                                                                                                                                                       |
| tag_filters       | source                                       | string        | The AWS log source to which the tag filters defined in `tags` are applied.                                                                                                                                                                                                  |
| tag_filters       | tags                                         | [string]      | The AWS resource tags to filter on for the log source specified by `source`.                                                                                                                                                                                                |
| lambda_forwarder  | sources                                      | [string]      | List of service IDs set to enable automatic log collection. Discover the list of available services with the [Get list of AWS log ready services](https://docs.datadoghq.com/api/latest/aws-logs-integration.md#get-list-of-aws-log-ready-services) endpoint.               |
| attributes        | metrics_config                               | object        | AWS Metrics Collection config.                                                                                                                                                                                                                                              |
| metrics_config    | automute_enabled                             | boolean       | Enable EC2 automute for AWS metrics. Defaults to `true`.                                                                                                                                                                                                                    |
| metrics_config    | collect_cloudwatch_alarms                    | boolean       | Enable CloudWatch alarms collection. Defaults to `false`.                                                                                                                                                                                                                   |
| metrics_config    | collect_custom_metrics                       | boolean       | Enable custom metrics collection. Defaults to `false`.                                                                                                                                                                                                                      |
| metrics_config    | enabled                                      | boolean       | Enable AWS metrics collection. Defaults to `true`.                                                                                                                                                                                                                          |
| metrics_config    | namespace_filters                            |  <oneOf> | AWS Metrics namespace filters. Defaults to `exclude_only`.                                                                                                                                                                                                                  |
| namespace_filters | Option 1                                     | object        | Exclude only these namespaces from metrics collection. Defaults to `["AWS/SQS", "AWS/ElasticMapReduce", "AWS/Usage"]`. `AWS/SQS`, `AWS/ElasticMapReduce`, and `AWS/Usage` are excluded by default to reduce your AWS CloudWatch costs from `GetMetricData` API calls.       |
| Option 1          | exclude_only [*required*]               | [string]      | Exclude only these namespaces from metrics collection. Defaults to `["AWS/SQS", "AWS/ElasticMapReduce", "AWS/Usage"]`. `AWS/SQS`, `AWS/ElasticMapReduce`, and `AWS/Usage` are excluded by default to reduce your AWS CloudWatch costs from `GetMetricData` API calls.       |
| namespace_filters | Option 2                                     | object        | Include only these namespaces.                                                                                                                                                                                                                                              |
| Option 2          | include_only [*required*]               | [string]      | Include only these namespaces.                                                                                                                                                                                                                                              |
| metrics_config    | tag_filters                                  | [object]      | AWS Metrics collection tag filters list. Defaults to `[]`.                                                                                                                                                                                                                  |
| tag_filters       | namespace                                    | string        | The AWS service for which the tag filters defined in `tags` will be applied.                                                                                                                                                                                                |
| tag_filters       | tags                                         | [string]      | The AWS resource tags to filter on for the service specified by `namespace`.                                                                                                                                                                                                |
| attributes        | modified_at                                  | date-time     | Timestamp of when the account integration was updated.                                                                                                                                                                                                                      |
| attributes        | resources_config                             | object        | AWS Resources Collection config.                                                                                                                                                                                                                                            |
| resources_config  | cloud_security_posture_management_collection | boolean       | Enable Cloud Security Management to scan AWS resources for vulnerabilities, misconfigurations, identity risks, and compliance violations. Defaults to `false`. Requires `extended_collection` to be set to `true`.                                                          |
| resources_config  | extended_collection                          | boolean       | Whether Datadog collects additional attributes and configuration information about the resources in your AWS account. Defaults to `true`. Required for `cloud_security_posture_management_collection`.                                                                      |
| attributes        | traces_config                                | object        | AWS Traces Collection config.                                                                                                                                                                                                                                               |
| traces_config     | xray_services                                |  <oneOf> | AWS X-Ray services to collect traces from. Defaults to `include_only`.                                                                                                                                                                                                      |
| xray_services     | Option 1                                     | object        | Include all services.                                                                                                                                                                                                                                                       |
| Option 1          | include_all [*required*]                | boolean       | Include all services.                                                                                                                                                                                                                                                       |
| xray_services     | Option 2                                     | object        | Include only these services. Defaults to `[]`.                                                                                                                                                                                                                              |
| Option 2          | include_only [*required*]               | [string]      | Include only these services.                                                                                                                                                                                                                                                |
| data              | id [*required*]                         | string        | Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the [List all AWS integrations](https://docs.datadoghq.com/api/latest/aws-integration.md#list-all-aws-integrations) endpoint and query by AWS Account ID.                 |
| data              | type [*required*]                       | enum          | AWS Account resource type. Allowed enum values: `account`                                                                                                                                                                                                                   |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "account_tags": [
        "env:prod"
      ],
      "auth_config": {
        "access_key_id": "AKIAIOSFODNN7EXAMPLE",
        "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
      },
      "aws_account_id": "123456789012",
      "aws_partition": "aws",
      "aws_regions": {
        "include_all": true
      },
      "created_at": "2019-09-19T10:00:00.000Z",
      "logs_config": {
        "lambda_forwarder": {
          "lambdas": [
            "arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"
          ],
          "log_source_config": {
            "tag_filters": [
              {
                "source": "s3",
                "tags": [
                  "env:prod"
                ]
              }
            ]
          },
          "sources": [
            "s3"
          ]
        }
      },
      "metrics_config": {
        "automute_enabled": true,
        "collect_cloudwatch_alarms": false,
        "collect_custom_metrics": false,
        "enabled": true,
        "namespace_filters": {
          "exclude_only": [
            "AWS/SQS",
            "AWS/ElasticMapReduce",
            "AWS/Usage"
          ]
        },
        "tag_filters": [
          {
            "namespace": "AWS/EC2",
            "tags": [
              "datadog:true"
            ]
          }
        ]
      },
      "modified_at": "2019-09-19T10:00:00.000Z",
      "resources_config": {
        "cloud_security_posture_management_collection": false,
        "extended_collection": true
      },
      "traces_config": {
        "xray_services": {
          "include_all": false
        }
      }
    },
    "id": "00000000-abcd-0001-0000-000000000000",
    "type": "account"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Path parameters export aws_account_config_id="CHANGE_ME" \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/integration/aws/accounts/${aws_account_config_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get an AWS integration by config ID returns "AWS Account object" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.aws_integration_api import AWSIntegrationApi

# there is a valid "aws_account_v2" in the system
AWS_ACCOUNT_V2_DATA_ID = environ["AWS_ACCOUNT_V2_DATA_ID"]

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = AWSIntegrationApi(api_client)
    response = api_instance.get_aws_account(
        aws_account_config_id=AWS_ACCOUNT_V2_DATA_ID,
    )

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
##### 

```ruby
# Get an AWS integration by config ID returns "AWS Account object" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new

# there is a valid "aws_account_v2" in the system
AWS_ACCOUNT_V2_DATA_ID = ENV["AWS_ACCOUNT_V2_DATA_ID"]
p api_instance.get_aws_account(AWS_ACCOUNT_V2_DATA_ID)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
##### 

```go
// Get an AWS integration by config ID returns "AWS Account object" 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() {
	// there is a valid "aws_account_v2" in the system
	AwsAccountV2DataID := os.Getenv("AWS_ACCOUNT_V2_DATA_ID")

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewAWSIntegrationApi(apiClient)
	resp, r, err := api.GetAWSAccount(ctx, AwsAccountV2DataID)

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

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

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
##### 

```java
// Get an AWS integration by config ID returns "AWS Account object" 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.AWSAccountResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient);

    // there is a valid "aws_account_v2" in the system
    String AWS_ACCOUNT_V2_DATA_ID = System.getenv("AWS_ACCOUNT_V2_DATA_ID");

    try {
      AWSAccountResponse result = apiInstance.getAWSAccount(AWS_ACCOUNT_V2_DATA_ID);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AwsIntegrationApi#getAWSAccount");
      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://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
##### 

```rust
// Get an AWS integration by config ID returns "AWS Account object" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_aws_integration::AWSIntegrationAPI;

#[tokio::main]
async fn main() {
    // there is a valid "aws_account_v2" in the system
    let aws_account_v2_data_id = std::env::var("AWS_ACCOUNT_V2_DATA_ID").unwrap();
    let configuration = datadog::Configuration::new();
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.get_aws_account(aws_account_v2_data_id.clone()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
##### 

```typescript
/**
 * Get an AWS integration by config ID returns "AWS Account object" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.AWSIntegrationApi(configuration);

// there is a valid "aws_account_v2" in the system
const AWS_ACCOUNT_V2_DATA_ID = process.env.AWS_ACCOUNT_V2_DATA_ID as string;

const params: v2.AWSIntegrationApiGetAWSAccountRequest = {
  awsAccountConfigId: AWS_ACCOUNT_V2_DATA_ID,
};

apiInstance
  .getAWSAccount(params)
  .then((data: v2.AWSAccountResponse) => {
    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://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
{% /tab %}
