Intégration AWS

Configurez votre intégration Datadog/AWS directement via l’API Datadog. Pour en savoir plus, consultez la page sur l’intégration AWS.

GET https://api.ap1.datadoghq.com/api/v1/integration/aws/filteringhttps://api.datadoghq.eu/api/v1/integration/aws/filteringhttps://api.ddog-gov.com/api/v1/integration/aws/filteringhttps://api.datadoghq.com/api/v1/integration/aws/filteringhttps://api.us3.datadoghq.com/api/v1/integration/aws/filteringhttps://api.us5.datadoghq.com/api/v1/integration/aws/filtering

Présentation

Récupérez tous les filtres de tags AWS. This endpoint requires the aws_configuration_read permission.

Arguments

Chaînes de requête

Nom

Type

Description

account_id [required]

string

Only return AWS filters that matches this account_id.

Réponse

OK

An array of tag filter rules by namespace and tag filter string.

Expand All

Champ

Type

Description

filters

[object]

An array of tag filters.

namespace

enum

The namespace associated with the tag filter entry. Allowed enum values: elb,application_elb,sqs,rds,custom,network_elb,lambda,step_functions

tag_filter_str

string

The tag filter string.

{
  "filters": [
    {
      "namespace": "string",
      "tag_filter_str": "prod*"
    }
  ]
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

/**
 * Get all AWS tag filters returns "OK" response
 */

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

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

const params: v1.AWSIntegrationApiListAWSTagFiltersRequest = {
  accountId: "account_id",
};

apiInstance
  .listAWSTagFilters(params)
  .then((data: v1.AWSTagFilterListResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

Note: This endpoint is in Preview. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/integration/aws/available_namespaceshttps://api.datadoghq.eu/api/v2/integration/aws/available_namespaceshttps://api.ddog-gov.com/api/v2/integration/aws/available_namespaceshttps://api.datadoghq.com/api/v2/integration/aws/available_namespaceshttps://api.us3.datadoghq.com/api/v2/integration/aws/available_namespaceshttps://api.us5.datadoghq.com/api/v2/integration/aws/available_namespaces

Présentation

Get a list of available AWS CloudWatch namespaces that can send metrics to Datadog. This endpoint requires the aws_configuration_read permission.

Réponse

AWS Namespaces List object

AWS Namespaces response body.

Expand All

Champ

Type

Description

data [required]

object

AWS Namespaces response data.

attributes

object

AWS Namespaces response attributes.

namespaces [required]

[string]

AWS CloudWatch namespace.

id [required]

string

The AWSNamespacesResponseData id.

default: namespaces

type [required]

enum

The AWSNamespacesResponseData type. Allowed enum values: namespaces

default: namespaces

{
  "data": {
    "attributes": {
      "namespaces": [
        "AWS/ApiGateway"
      ]
    },
    "id": "namespaces",
    "type": "namespaces"
  }
}

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

/**
 * List available namespaces returns "AWS Namespaces List object" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listAWSNamespaces"] = true;
const apiInstance = new v2.AWSIntegrationApi(configuration);

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

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v1/integration/aws/filteringhttps://api.datadoghq.eu/api/v1/integration/aws/filteringhttps://api.ddog-gov.com/api/v1/integration/aws/filteringhttps://api.datadoghq.com/api/v1/integration/aws/filteringhttps://api.us3.datadoghq.com/api/v1/integration/aws/filteringhttps://api.us5.datadoghq.com/api/v1/integration/aws/filtering

Présentation

Définissez un filtre de tags AWS. This endpoint requires the aws_configuration_edit permission.

Requête

Body Data (required)

Définissez un filtre de tags AWS à l’aide d’un aws_account_identifier, d’un namespace et d’une chaîne de filtrage. Les options d’espace de nommage sont application_elb, elb, lambda, network_elb, rds, sqs, et custom.

Expand All

Champ

Type

Description

account_id

string

Your AWS Account ID without dashes.

namespace

enum

The namespace associated with the tag filter entry. Allowed enum values: elb,application_elb,sqs,rds,custom,network_elb,lambda,step_functions

tag_filter_str

string

The tag filter string.

{
  "account_id": "123456789012",
  "namespace": "string",
  "tag_filter_str": "prod*"
}

Réponse

OK

Expand All

Champ

Type

Description

No response body

{}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

/**
 * Set an AWS tag filter returns "OK" response
 */

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

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

const params: v1.AWSIntegrationApiCreateAWSTagFilterRequest = {
  body: {
    accountId: "123456789012",
    namespace: "elb",
    tagFilterStr: "prod*",
  },
};

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

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

DELETE https://api.ap1.datadoghq.com/api/v1/integration/aws/filteringhttps://api.datadoghq.eu/api/v1/integration/aws/filteringhttps://api.ddog-gov.com/api/v1/integration/aws/filteringhttps://api.datadoghq.com/api/v1/integration/aws/filteringhttps://api.us3.datadoghq.com/api/v1/integration/aws/filteringhttps://api.us5.datadoghq.com/api/v1/integration/aws/filtering

Présentation

Supprimez une entrée de filtrage de tags. This endpoint requires the aws_configuration_edit permission.

Requête

Body Data (required)

Supprimez une entrée de filtrage de tags pour un compte AWS et un espace de nommage dd-aws donnés.

Expand All

Champ

Type

Description

account_id

string

The unique identifier of your AWS account.

namespace

enum

The namespace associated with the tag filter entry. Allowed enum values: elb,application_elb,sqs,rds,custom,network_elb,lambda,step_functions

{
  "account_id": "FAKEAC0FAKEAC2FAKEAC",
  "namespace": "string"
}

Réponse

OK

Expand All

Champ

Type

Description

No response body

{}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

/**
 * Delete a tag filtering entry returns "OK" response
 */

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

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

const params: v1.AWSIntegrationApiDeleteAWSTagFilterRequest = {
  body: {
    accountId: "FAKEAC0FAKEAC2FAKEAC",
    namespace: "elb",
  },
};

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

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

Note: This endpoint is in Preview. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id}https://api.datadoghq.eu/api/v2/integration/aws/accounts/{aws_account_config_id}https://api.ddog-gov.com/api/v2/integration/aws/accounts/{aws_account_config_id}https://api.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id}https://api.us3.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id}https://api.us5.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id}

Présentation

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

Arguments

Paramètres du chemin

Nom

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 endpoint and query by AWS Account ID.

Réponse

AWS Account object

AWS Account response body.

Expand All

Champ

Type

Description

data [required]

object

AWS Account response data.

attributes

object

AWS Account response attributes.

account_tags

[string]

Tags to apply to all hosts and metrics reporting for this account. Defaults to [].

auth_config

 <oneOf>

AWS Authentication config.

Option 1

object

AWS Authentication config to integrate your account using an access key pair.

access_key_id [required]

string

AWS Access Key ID.

secret_access_key

string

AWS Secret Access Key.

Option 2

object

AWS Authentication config to integrate your account using an IAM role.

external_id

string

AWS IAM External ID for associated role.

role_name [required]

string

AWS IAM Role name.

aws_account_id [required]

string

AWS Account ID.

aws_partition

enum

AWS partition your AWS account is scoped to. Defaults to aws. See Partitions in the AWS documentation for more information. Allowed enum values: aws,aws-cn,aws-us-gov

aws_regions

 <oneOf>

AWS Regions to collect data from. Defaults to include_all.

Option 1

object

Include all regions. Defaults to true.

include_all [required]

boolean

Include all regions.

Option 2

object

Include only these regions.

include_only [required]

[string]

Include only these regions.

created_at

date-time

Timestamp of when the account integration was created.

logs_config

object

AWS Logs Collection 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.

lambdas

[string]

List of Datadog Lambda Log Forwarder ARNs in your AWS account. Defaults to [].

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 endpoint.

metrics_config

object

AWS Metrics Collection config.

automute_enabled

boolean

Enable EC2 automute for AWS metrics. Defaults to true.

collect_cloudwatch_alarms

boolean

Enable CloudWatch alarms collection. Defaults to false.

collect_custom_metrics

boolean

Enable custom metrics collection. Defaults to false.

enabled

boolean

Enable AWS metrics collection. Defaults to true.

namespace_filters

 <oneOf>

AWS Metrics namespace filters. Defaults to exclude_only.

Option 1

object

Exclude only these namespaces from metrics collection. Defaults to ["AWS/SQS", "AWS/ElasticMapReduce"]. AWS/SQS and AWS/ElasticMapReduce are excluded by default to reduce your AWS CloudWatch costs from GetMetricData API calls.

exclude_only [required]

[string]

Exclude only these namespaces from metrics collection. Defaults to ["AWS/SQS", "AWS/ElasticMapReduce"]. AWS/SQS and AWS/ElasticMapReduce are excluded by default to reduce your AWS CloudWatch costs from GetMetricData API calls.

Option 2

object

Include only these namespaces.

include_only [required]

[string]

Include only these namespaces.

tag_filters

[object]

AWS Metrics collection tag filters list. Defaults to [].

namespace

string

The AWS service for which the tag filters defined in tags will be applied.

tags

[string]

The AWS resource tags to filter on for the service specified by namespace.

modified_at

date-time

Timestamp of when the account integration was updated.

resources_config

object

AWS Resources Collection 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.

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.

traces_config

object

AWS Traces Collection config.

xray_services

 <oneOf>

AWS X-Ray services to collect traces from. Defaults to include_only.

Option 1

object

Include all services.

include_all [required]

boolean

Include all services.

Option 2

object

Include only these services. Defaults to [].

include_only [required]

[string]

Include only these services.

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 endpoint and query by AWS Account ID.

type [required]

enum

AWS Account resource type. Allowed enum values: account

default: account

{
  "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"
          ],
          "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"
          ]
        },
        "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"
  }
}

Bad Request

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

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

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getAWSAccount"] = true;
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 and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

Note: For the "v2" version of this endpoint, which is in beta, see Generate a new external ID v2.

PUT https://api.ap1.datadoghq.com/api/v1/integration/aws/generate_new_external_idhttps://api.datadoghq.eu/api/v1/integration/aws/generate_new_external_idhttps://api.ddog-gov.com/api/v1/integration/aws/generate_new_external_idhttps://api.datadoghq.com/api/v1/integration/aws/generate_new_external_idhttps://api.us3.datadoghq.com/api/v1/integration/aws/generate_new_external_idhttps://api.us5.datadoghq.com/api/v1/integration/aws/generate_new_external_id

Présentation

Générez un nouvel ID externe AWS pour une paire ID de compte AWS/nom de rôle donnée. This endpoint requires the aws_configuration_edit permission.

Requête

Body Data (required)

Le nom de votre délégation de rôle Datadog. Consultez les [informations sur la configuration de l’intégration Datadog/AWS] pour en savoir plus sur le nom de rôle de votre compte AWS (https://github.com/DataDog/documentation/blob/master/integrations/amazon_web_services/#installation).

Expand All

Champ

Type

Description

access_key_id

string

Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.

account_id

string

Your AWS Account ID without dashes.

account_specific_namespace_rules

object

An object, (in the form {"namespace1":true/false, "namespace2":true/false}), that enables or disables metric collection for specific AWS namespaces for this AWS account only.

<any-key>

boolean

A list of additional properties.

cspm_resource_collection_enabled

boolean

Whether Datadog collects cloud security posture management resources from your AWS account. This includes additional resources not covered under the general resource_collection.

excluded_regions

[string]

An array of AWS regions to exclude from metrics collection.

extended_resource_collection_enabled

boolean

Whether Datadog collects additional attributes and configuration information about the resources in your AWS account. Required for cspm_resource_collection.

filter_tags

[string]

The array of EC2 tags (in the form key:value) defines a filter that Datadog uses when collecting metrics from EC2. Wildcards, such as ? (for single characters) and * (for multiple characters) can also be used. Only hosts that match one of the defined tags will be imported into Datadog. The rest will be ignored. Host matching a given tag can also be excluded by adding ! before the tag. For example, env:production,instance-type:c1.*,!region:us-east-1

host_tags

[string]

Array of tags (in the form key:value) to add to all hosts and metrics reporting through this integration.

metrics_collection_enabled

boolean

Whether Datadog collects metrics for this AWS account.

default: true

resource_collection_enabled

boolean

DEPRECATED: Deprecated in favor of 'extended_resource_collection_enabled'. Whether Datadog collects a standard set of resources from your AWS account.

role_name

string

Your Datadog role delegation name.

secret_access_key

string

Your AWS secret access key. Only required if your AWS account is a GovCloud or China account.

{
  "access_key_id": "string",
  "account_id": "123456789012",
  "account_specific_namespace_rules": {
    "<any-key>": false
  },
  "cspm_resource_collection_enabled": true,
  "excluded_regions": [
    "us-east-1",
    "us-west-2"
  ],
  "extended_resource_collection_enabled": true,
  "filter_tags": [
    "$KEY:$VALUE"
  ],
  "host_tags": [
    "$KEY:$VALUE"
  ],
  "metrics_collection_enabled": false,
  "resource_collection_enabled": true,
  "role_name": "DatadogAWSIntegrationRole",
  "secret_access_key": "string"
}

Réponse

OK

The Response returned by the AWS Create Account call.

Expand All

Champ

Type

Description

external_id

string

AWS external_id.

{
  "external_id": "string"
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

/**
 * Generate a new external ID returns "OK" response
 */

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

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

const params: v1.AWSIntegrationApiCreateNewAWSExternalIDRequest = {
  body: {
    accountId: "123456789012",
    accountSpecificNamespaceRules: {
      auto_scaling: false,
      opswork: false,
    },
    cspmResourceCollectionEnabled: true,
    excludedRegions: ["us-east-1", "us-west-2"],
    extendedResourceCollectionEnabled: true,
    filterTags: ["$KEY:$VALUE"],
    hostTags: ["$KEY:$VALUE"],
    metricsCollectionEnabled: false,
    resourceCollectionEnabled: true,
    roleName: "DatadogAWSIntegrationRole",
  },
};

apiInstance
  .createNewAWSExternalID(params)
  .then((data: v1.AWSAccountCreateResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

Note: This endpoint is in Preview. If you have any feedback, contact Datadog support.

POST https://api.ap1.datadoghq.com/api/v2/integration/aws/generate_new_external_idhttps://api.datadoghq.eu/api/v2/integration/aws/generate_new_external_idhttps://api.ddog-gov.com/api/v2/integration/aws/generate_new_external_idhttps://api.datadoghq.com/api/v2/integration/aws/generate_new_external_idhttps://api.us3.datadoghq.com/api/v2/integration/aws/generate_new_external_idhttps://api.us5.datadoghq.com/api/v2/integration/aws/generate_new_external_id

Présentation

Générez un nouvel ID externe AWS pour une paire ID de compte AWS/nom de rôle donnée. This endpoint requires the aws_configuration_edit permission.

Réponse

AWS External ID object

AWS External ID response body.

Expand All

Champ

Type

Description

data [required]

object

AWS External ID response body.

attributes

object

AWS External ID response body.

external_id [required]

string

AWS IAM External ID for associated role.

id [required]

string

The AWSNewExternalIDResponseData id.

default: external_id

type [required]

enum

The AWSNewExternalIDResponseData type. Allowed enum values: external_id

default: external_id

{
  "data": {
    "attributes": {
      "external_id": "acb8f6b8a844443dbb726d07dcb1a870"
    },
    "id": "external_id",
    "type": "external_id"
  }
}

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

/**
 * Generate a new external ID returns "AWS External ID object" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createNewAWSExternalID"] = true;
const apiInstance = new v2.AWSIntegrationApi(configuration);

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

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

GET https://api.ap1.datadoghq.com/api/v1/integration/aws/available_namespace_ruleshttps://api.datadoghq.eu/api/v1/integration/aws/available_namespace_ruleshttps://api.ddog-gov.com/api/v1/integration/aws/available_namespace_ruleshttps://api.datadoghq.com/api/v1/integration/aws/available_namespace_ruleshttps://api.us3.datadoghq.com/api/v1/integration/aws/available_namespace_ruleshttps://api.us5.datadoghq.com/api/v1/integration/aws/available_namespace_rules

Présentation

Énumérez toutes les règles d’espace de nommage pour une intégration Datadog/AWS donnée. Cet endpoint ne prend aucun argument. This endpoint requires the aws_configuration_read permission.

Réponse

OK

Expand All

Champ

Type

Description

string

[
  "namespace1",
  "namespace2",
  "namespace3"
]

Authentication Error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

/**
 * List namespace rules returns "OK" response
 */

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

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

apiInstance
  .listAvailableAWSNamespaces()
  .then((data: string[]) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

Note: For the "v2" version of this endpoint, which is in beta, see List all AWS integrations v2.

GET https://api.ap1.datadoghq.com/api/v1/integration/awshttps://api.datadoghq.eu/api/v1/integration/awshttps://api.ddog-gov.com/api/v1/integration/awshttps://api.datadoghq.com/api/v1/integration/awshttps://api.us3.datadoghq.com/api/v1/integration/awshttps://api.us5.datadoghq.com/api/v1/integration/aws

Présentation

Énumérez toutes les intégrations Datadog/AWS disponibles au sein de votre organisation Datadog. This endpoint requires the aws_configuration_read permission.

Arguments

Chaînes de requête

Nom

Type

Description

account_id

string

Only return AWS accounts that matches this account_id.

role_name

string

Only return AWS accounts that matches this role_name.

access_key_id

string

Only return AWS accounts that matches this access_key_id.

Réponse

OK

List of enabled AWS accounts.

Expand All

Champ

Type

Description

accounts

[object]

List of enabled AWS accounts.

access_key_id

string

Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.

account_id

string

Your AWS Account ID without dashes.

account_specific_namespace_rules

object

An object, (in the form {"namespace1":true/false, "namespace2":true/false}), that enables or disables metric collection for specific AWS namespaces for this AWS account only.

<any-key>

boolean

A list of additional properties.

cspm_resource_collection_enabled

boolean

Whether Datadog collects cloud security posture management resources from your AWS account. This includes additional resources not covered under the general resource_collection.

excluded_regions

[string]

An array of AWS regions to exclude from metrics collection.

extended_resource_collection_enabled

boolean

Whether Datadog collects additional attributes and configuration information about the resources in your AWS account. Required for cspm_resource_collection.

filter_tags

[string]

The array of EC2 tags (in the form key:value) defines a filter that Datadog uses when collecting metrics from EC2. Wildcards, such as ? (for single characters) and * (for multiple characters) can also be used. Only hosts that match one of the defined tags will be imported into Datadog. The rest will be ignored. Host matching a given tag can also be excluded by adding ! before the tag. For example, env:production,instance-type:c1.*,!region:us-east-1

host_tags

[string]

Array of tags (in the form key:value) to add to all hosts and metrics reporting through this integration.

metrics_collection_enabled

boolean

Whether Datadog collects metrics for this AWS account.

default: true

resource_collection_enabled

boolean

DEPRECATED: Deprecated in favor of 'extended_resource_collection_enabled'. Whether Datadog collects a standard set of resources from your AWS account.

role_name

string

Your Datadog role delegation name.

secret_access_key

string

Your AWS secret access key. Only required if your AWS account is a GovCloud or China account.

{
  "accounts": [
    {
      "access_key_id": "string",
      "account_id": "123456789012",
      "account_specific_namespace_rules": {
        "<any-key>": false
      },
      "cspm_resource_collection_enabled": true,
      "excluded_regions": [
        "us-east-1",
        "us-west-2"
      ],
      "extended_resource_collection_enabled": true,
      "filter_tags": [
        "$KEY:$VALUE"
      ],
      "host_tags": [
        "$KEY:$VALUE"
      ],
      "metrics_collection_enabled": false,
      "resource_collection_enabled": true,
      "role_name": "DatadogAWSIntegrationRole",
      "secret_access_key": "string"
    }
  ]
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

/**
 * List all AWS integrations returns "OK" response
 */

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

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

apiInstance
  .listAWSAccounts()
  .then((data: v1.AWSAccountListResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

Note: This endpoint is in Preview. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/integration/aws/accountshttps://api.datadoghq.eu/api/v2/integration/aws/accountshttps://api.ddog-gov.com/api/v2/integration/aws/accountshttps://api.datadoghq.com/api/v2/integration/aws/accountshttps://api.us3.datadoghq.com/api/v2/integration/aws/accountshttps://api.us5.datadoghq.com/api/v2/integration/aws/accounts

Présentation

Énumérez toutes les intégrations Datadog/AWS disponibles au sein de votre organisation Datadog. This endpoint requires the aws_configuration_read permission.

Arguments

Chaînes de requête

Nom

Type

Description

aws_account_id

string

Optional query parameter to filter accounts by AWS Account ID. If not provided, all accounts are returned.

Réponse

AWS Accounts List object

AWS Accounts response body.

Expand All

Champ

Type

Description

data [required]

[object]

List of AWS Account Integration Configs.

attributes

object

AWS Account response attributes.

account_tags

[string]

Tags to apply to all hosts and metrics reporting for this account. Defaults to [].

auth_config

 <oneOf>

AWS Authentication config.

Option 1

object

AWS Authentication config to integrate your account using an access key pair.

access_key_id [required]

string

AWS Access Key ID.

secret_access_key

string

AWS Secret Access Key.

Option 2

object

AWS Authentication config to integrate your account using an IAM role.

external_id

string

AWS IAM External ID for associated role.

role_name [required]

string

AWS IAM Role name.

aws_account_id [required]

string

AWS Account ID.

aws_partition

enum

AWS partition your AWS account is scoped to. Defaults to aws. See Partitions in the AWS documentation for more information. Allowed enum values: aws,aws-cn,aws-us-gov

aws_regions

 <oneOf>

AWS Regions to collect data from. Defaults to include_all.

Option 1

object

Include all regions. Defaults to true.

include_all [required]

boolean

Include all regions.

Option 2

object

Include only these regions.

include_only [required]

[string]

Include only these regions.

created_at

date-time

Timestamp of when the account integration was created.

logs_config

object

AWS Logs Collection 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.

lambdas

[string]

List of Datadog Lambda Log Forwarder ARNs in your AWS account. Defaults to [].

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 endpoint.

metrics_config

object

AWS Metrics Collection config.

automute_enabled

boolean

Enable EC2 automute for AWS metrics. Defaults to true.

collect_cloudwatch_alarms

boolean

Enable CloudWatch alarms collection. Defaults to false.

collect_custom_metrics

boolean

Enable custom metrics collection. Defaults to false.

enabled

boolean

Enable AWS metrics collection. Defaults to true.

namespace_filters

 <oneOf>

AWS Metrics namespace filters. Defaults to exclude_only.

Option 1

object

Exclude only these namespaces from metrics collection. Defaults to ["AWS/SQS", "AWS/ElasticMapReduce"]. AWS/SQS and AWS/ElasticMapReduce are excluded by default to reduce your AWS CloudWatch costs from GetMetricData API calls.

exclude_only [required]

[string]

Exclude only these namespaces from metrics collection. Defaults to ["AWS/SQS", "AWS/ElasticMapReduce"]. AWS/SQS and AWS/ElasticMapReduce are excluded by default to reduce your AWS CloudWatch costs from GetMetricData API calls.

Option 2

object

Include only these namespaces.

include_only [required]

[string]

Include only these namespaces.

tag_filters

[object]

AWS Metrics collection tag filters list. Defaults to [].

namespace

string

The AWS service for which the tag filters defined in tags will be applied.

tags

[string]

The AWS resource tags to filter on for the service specified by namespace.

modified_at

date-time

Timestamp of when the account integration was updated.

resources_config

object

AWS Resources Collection 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.

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.

traces_config

object

AWS Traces Collection config.

xray_services

 <oneOf>

AWS X-Ray services to collect traces from. Defaults to include_only.

Option 1

object

Include all services.

include_all [required]

boolean

Include all services.

Option 2

object

Include only these services. Defaults to [].

include_only [required]

[string]

Include only these services.

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 endpoint and query by AWS Account ID.

type [required]

enum

AWS Account resource type. Allowed enum values: account

default: account

{
  "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"
            ],
            "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"
            ]
          },
          "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"
    }
  ]
}

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

/**
 * List all AWS integrations returns "AWS Accounts List object" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listAWSAccounts"] = true;
const apiInstance = new v2.AWSIntegrationApi(configuration);

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

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

Note: For the "v2" version of this endpoint, which is in beta, see Delete an AWS integration v2.

DELETE https://api.ap1.datadoghq.com/api/v1/integration/awshttps://api.datadoghq.eu/api/v1/integration/awshttps://api.ddog-gov.com/api/v1/integration/awshttps://api.datadoghq.com/api/v1/integration/awshttps://api.us3.datadoghq.com/api/v1/integration/awshttps://api.us5.datadoghq.com/api/v1/integration/aws

Présentation

Supprimez une intégration Datadog/AWS correspondant aux valeurs account_id et role_name parameters indiquées. This endpoint requires the aws_configurations_manage permission.

Requête

Body Data (required)

Objet de requête AWS

Expand All

Champ

Type

Description

access_key_id

string

Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.

account_id

string

Your AWS Account ID without dashes.

role_name

string

Your Datadog role delegation name.

{
  "account_id": "163662907100",
  "role_name": "DatadogAWSIntegrationRole"
}

Réponse

OK

Expand All

Champ

Type

Description

No response body

{}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Conflict Error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

/**
 * Delete an AWS integration returns "OK" response
 */

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

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

const params: v1.AWSIntegrationApiDeleteAWSAccountRequest = {
  body: {
    accountId: "163662907100",
    roleName: "DatadogAWSIntegrationRole",
  },
};

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

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

Note: This endpoint is in Preview. If you have any feedback, contact Datadog support.

DELETE https://api.ap1.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id}https://api.datadoghq.eu/api/v2/integration/aws/accounts/{aws_account_config_id}https://api.ddog-gov.com/api/v2/integration/aws/accounts/{aws_account_config_id}https://api.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id}https://api.us3.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id}https://api.us5.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id}

Présentation

Supprimez une intégration Datadog/AWS correspondant aux valeurs account_id et role_name parameters indiquées. This endpoint requires the aws_configurations_manage permission.

Arguments

Paramètres du chemin

Nom

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 endpoint and query by AWS Account ID.

Réponse

No Content

Bad Request

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

/**
 * Delete an AWS integration returns "No Content" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteAWSAccount"] = true;
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.AWSIntegrationApiDeleteAWSAccountRequest = {
  awsAccountConfigId: AWS_ACCOUNT_V2_DATA_ID,
};

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

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

Note: For the "v2" version of this endpoint, which is in beta, see Create an AWS integration v2.

POST https://api.ap1.datadoghq.com/api/v1/integration/awshttps://api.datadoghq.eu/api/v1/integration/awshttps://api.ddog-gov.com/api/v1/integration/awshttps://api.datadoghq.com/api/v1/integration/awshttps://api.us3.datadoghq.com/api/v1/integration/awshttps://api.us5.datadoghq.com/api/v1/integration/aws

Présentation

Créez une intégration Datadog/Amazon Web Services. La méthode POST permet de mettre à jour la configuration de votre intégration en ajoutant votre nouvelle configuration à celle de votre organisation Datadog. Un identifiant de compte AWS unique pour l’authentification basée sur les rôles. This endpoint requires the aws_configurations_manage permission.

Requête

Body Data (required)

Objet de requête AWS

Expand All

Champ

Type

Description

access_key_id

string

Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.

account_id

string

Your AWS Account ID without dashes.

account_specific_namespace_rules

object

An object, (in the form {"namespace1":true/false, "namespace2":true/false}), that enables or disables metric collection for specific AWS namespaces for this AWS account only.

<any-key>

boolean

A list of additional properties.

cspm_resource_collection_enabled

boolean

Whether Datadog collects cloud security posture management resources from your AWS account. This includes additional resources not covered under the general resource_collection.

excluded_regions

[string]

An array of AWS regions to exclude from metrics collection.

extended_resource_collection_enabled

boolean

Whether Datadog collects additional attributes and configuration information about the resources in your AWS account. Required for cspm_resource_collection.

filter_tags

[string]

The array of EC2 tags (in the form key:value) defines a filter that Datadog uses when collecting metrics from EC2. Wildcards, such as ? (for single characters) and * (for multiple characters) can also be used. Only hosts that match one of the defined tags will be imported into Datadog. The rest will be ignored. Host matching a given tag can also be excluded by adding ! before the tag. For example, env:production,instance-type:c1.*,!region:us-east-1

host_tags

[string]

Array of tags (in the form key:value) to add to all hosts and metrics reporting through this integration.

metrics_collection_enabled

boolean

Whether Datadog collects metrics for this AWS account.

default: true

resource_collection_enabled

boolean

DEPRECATED: Deprecated in favor of 'extended_resource_collection_enabled'. Whether Datadog collects a standard set of resources from your AWS account.

role_name

string

Your Datadog role delegation name.

secret_access_key

string

Your AWS secret access key. Only required if your AWS account is a GovCloud or China account.

{
  "account_id": "163662907100",
  "account_specific_namespace_rules": {
    "auto_scaling": false
  },
  "cspm_resource_collection_enabled": true,
  "excluded_regions": [
    "us-east-1",
    "us-west-2"
  ],
  "extended_resource_collection_enabled": true,
  "filter_tags": [
    "$KEY:$VALUE"
  ],
  "host_tags": [
    "$KEY:$VALUE"
  ],
  "metrics_collection_enabled": false,
  "role_name": "DatadogAWSIntegrationRole"
}

Réponse

OK

The Response returned by the AWS Create Account call.

Expand All

Champ

Type

Description

external_id

string

AWS external_id.

{
  "external_id": "string"
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Conflict Error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

/**
 * Create an AWS integration returns "OK" response
 */

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

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

const params: v1.AWSIntegrationApiCreateAWSAccountRequest = {
  body: {
    accountId: "163662907100",
    accountSpecificNamespaceRules: {
      auto_scaling: false,
    },
    cspmResourceCollectionEnabled: true,
    excludedRegions: ["us-east-1", "us-west-2"],
    extendedResourceCollectionEnabled: true,
    filterTags: ["$KEY:$VALUE"],
    hostTags: ["$KEY:$VALUE"],
    metricsCollectionEnabled: false,
    roleName: "DatadogAWSIntegrationRole",
  },
};

apiInstance
  .createAWSAccount(params)
  .then((data: v1.AWSAccountCreateResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

Note: This endpoint is in Preview. If you have any feedback, contact Datadog support.

POST https://api.ap1.datadoghq.com/api/v2/integration/aws/accountshttps://api.datadoghq.eu/api/v2/integration/aws/accountshttps://api.ddog-gov.com/api/v2/integration/aws/accountshttps://api.datadoghq.com/api/v2/integration/aws/accountshttps://api.us3.datadoghq.com/api/v2/integration/aws/accountshttps://api.us5.datadoghq.com/api/v2/integration/aws/accounts

Présentation

Créez une intégration Datadog/Amazon Web Services. La méthode POST permet de mettre à jour la configuration de votre intégration en ajoutant votre nouvelle configuration à celle de votre organisation Datadog. Un identifiant de compte AWS unique pour l’authentification basée sur les rôles. This endpoint requires the aws_configurations_manage permission.

Requête

Body Data (required)

Objet de requête AWS

Expand All

Champ

Type

Description

data [required]

object

AWS Account Create Request data.

attributes [required]

object

The AWS Account Integration Config to be created.

account_tags

[string]

Tags to apply to all hosts and metrics reporting for this account. Defaults to [].

auth_config [required]

 <oneOf>

AWS Authentication config.

Option 1

object

AWS Authentication config to integrate your account using an access key pair.

access_key_id [required]

string

AWS Access Key ID.

secret_access_key

string

AWS Secret Access Key.

Option 2

object

AWS Authentication config to integrate your account using an IAM role.

external_id

string

AWS IAM External ID for associated role.

role_name [required]

string

AWS IAM Role name.

aws_account_id [required]

string

AWS Account ID.

aws_partition [required]

enum

AWS partition your AWS account is scoped to. Defaults to aws. See Partitions in the AWS documentation for more information. Allowed enum values: aws,aws-cn,aws-us-gov

aws_regions

 <oneOf>

AWS Regions to collect data from. Defaults to include_all.

Option 1

object

Include all regions. Defaults to true.

include_all [required]

boolean

Include all regions.

Option 2

object

Include only these regions.

include_only [required]

[string]

Include only these regions.

logs_config

object

AWS Logs Collection 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.

lambdas

[string]

List of Datadog Lambda Log Forwarder ARNs in your AWS account. Defaults to [].

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 endpoint.

metrics_config

object

AWS Metrics Collection config.

automute_enabled

boolean

Enable EC2 automute for AWS metrics. Defaults to true.

collect_cloudwatch_alarms

boolean

Enable CloudWatch alarms collection. Defaults to false.

collect_custom_metrics

boolean

Enable custom metrics collection. Defaults to false.

enabled

boolean

Enable AWS metrics collection. Defaults to true.

namespace_filters

 <oneOf>

AWS Metrics namespace filters. Defaults to exclude_only.

Option 1

object

Exclude only these namespaces from metrics collection. Defaults to ["AWS/SQS", "AWS/ElasticMapReduce"]. AWS/SQS and AWS/ElasticMapReduce are excluded by default to reduce your AWS CloudWatch costs from GetMetricData API calls.

exclude_only [required]

[string]

Exclude only these namespaces from metrics collection. Defaults to ["AWS/SQS", "AWS/ElasticMapReduce"]. AWS/SQS and AWS/ElasticMapReduce are excluded by default to reduce your AWS CloudWatch costs from GetMetricData API calls.

Option 2

object

Include only these namespaces.

include_only [required]

[string]

Include only these namespaces.

tag_filters

[object]

AWS Metrics collection tag filters list. Defaults to [].

namespace

string

The AWS service for which the tag filters defined in tags will be applied.

tags

[string]

The AWS resource tags to filter on for the service specified by namespace.

resources_config

object

AWS Resources Collection 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.

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.

traces_config

object

AWS Traces Collection config.

xray_services

 <oneOf>

AWS X-Ray services to collect traces from. Defaults to include_only.

Option 1

object

Include all services.

include_all [required]

boolean

Include all services.

Option 2

object

Include only these services. Defaults to [].

include_only [required]

[string]

Include only these services.

type [required]

enum

AWS Account resource type. Allowed enum values: account

default: account

{
  "data": {
    "attributes": {
      "account_tags": [
        "key:value"
      ],
      "auth_config": {
        "role_name": "DatadogIntegrationRole"
      },
      "aws_account_id": "123456789012",
      "aws_partition": "aws",
      "logs_config": {
        "lambda_forwarder": {
          "lambdas": [
            "arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"
          ],
          "sources": [
            "s3"
          ]
        }
      },
      "metrics_config": {
        "automute_enabled": true,
        "collect_cloudwatch_alarms": true,
        "collect_custom_metrics": true,
        "enabled": true,
        "tag_filters": [
          {
            "namespace": "AWS/EC2",
            "tags": [
              "key:value"
            ]
          }
        ]
      },
      "resources_config": {
        "cloud_security_posture_management_collection": false,
        "extended_collection": false
      },
      "traces_config": {}
    },
    "type": "account"
  }
}
{
  "data": {
    "attributes": {
      "account_tags": [
        "key:value"
      ],
      "auth_config": {
        "access_key_id": "AKIAIOSFODNN7EXAMPLE",
        "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
      },
      "aws_account_id": "123456789012",
      "aws_partition": "aws",
      "logs_config": {
        "lambda_forwarder": {
          "lambdas": [
            "arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"
          ],
          "sources": [
            "s3"
          ]
        }
      },
      "metrics_config": {
        "automute_enabled": true,
        "collect_cloudwatch_alarms": true,
        "collect_custom_metrics": true,
        "enabled": true,
        "tag_filters": [
          {
            "namespace": "AWS/EC2",
            "tags": [
              "key:value"
            ]
          }
        ]
      },
      "resources_config": {
        "cloud_security_posture_management_collection": false,
        "extended_collection": false
      },
      "traces_config": {}
    },
    "type": "account"
  }
}

Réponse

AWS Account object

AWS Account response body.

Expand All

Champ

Type

Description

data [required]

object

AWS Account response data.

attributes

object

AWS Account response attributes.

account_tags

[string]

Tags to apply to all hosts and metrics reporting for this account. Defaults to [].

auth_config

 <oneOf>

AWS Authentication config.

Option 1

object

AWS Authentication config to integrate your account using an access key pair.

access_key_id [required]

string

AWS Access Key ID.

secret_access_key

string

AWS Secret Access Key.

Option 2

object

AWS Authentication config to integrate your account using an IAM role.

external_id

string

AWS IAM External ID for associated role.

role_name [required]

string

AWS IAM Role name.

aws_account_id [required]

string

AWS Account ID.

aws_partition

enum

AWS partition your AWS account is scoped to. Defaults to aws. See Partitions in the AWS documentation for more information. Allowed enum values: aws,aws-cn,aws-us-gov

aws_regions

 <oneOf>

AWS Regions to collect data from. Defaults to include_all.

Option 1

object

Include all regions. Defaults to true.

include_all [required]

boolean

Include all regions.

Option 2

object

Include only these regions.

include_only [required]

[string]

Include only these regions.

created_at

date-time

Timestamp of when the account integration was created.

logs_config

object

AWS Logs Collection 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.

lambdas

[string]

List of Datadog Lambda Log Forwarder ARNs in your AWS account. Defaults to [].

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 endpoint.

metrics_config

object

AWS Metrics Collection config.

automute_enabled

boolean

Enable EC2 automute for AWS metrics. Defaults to true.

collect_cloudwatch_alarms

boolean

Enable CloudWatch alarms collection. Defaults to false.

collect_custom_metrics

boolean

Enable custom metrics collection. Defaults to false.

enabled

boolean

Enable AWS metrics collection. Defaults to true.

namespace_filters

 <oneOf>

AWS Metrics namespace filters. Defaults to exclude_only.

Option 1

object

Exclude only these namespaces from metrics collection. Defaults to ["AWS/SQS", "AWS/ElasticMapReduce"]. AWS/SQS and AWS/ElasticMapReduce are excluded by default to reduce your AWS CloudWatch costs from GetMetricData API calls.

exclude_only [required]

[string]

Exclude only these namespaces from metrics collection. Defaults to ["AWS/SQS", "AWS/ElasticMapReduce"]. AWS/SQS and AWS/ElasticMapReduce are excluded by default to reduce your AWS CloudWatch costs from GetMetricData API calls.

Option 2

object

Include only these namespaces.

include_only [required]

[string]

Include only these namespaces.

tag_filters

[object]

AWS Metrics collection tag filters list. Defaults to [].

namespace

string

The AWS service for which the tag filters defined in tags will be applied.

tags

[string]

The AWS resource tags to filter on for the service specified by namespace.

modified_at

date-time

Timestamp of when the account integration was updated.

resources_config

object

AWS Resources Collection 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.

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.

traces_config

object

AWS Traces Collection config.

xray_services

 <oneOf>

AWS X-Ray services to collect traces from. Defaults to include_only.

Option 1

object

Include all services.

include_all [required]

boolean

Include all services.

Option 2

object

Include only these services. Defaults to [].

include_only [required]

[string]

Include only these services.

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 endpoint and query by AWS Account ID.

type [required]

enum

AWS Account resource type. Allowed enum values: account

default: account

{
  "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"
          ],
          "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"
          ]
        },
        "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"
  }
}

Bad Request

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Conflict

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

/**
 * Create an AWS account returns "AWS Account object" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createAWSAccount"] = true;
const apiInstance = new v2.AWSIntegrationApi(configuration);

const params: v2.AWSIntegrationApiCreateAWSAccountRequest = {
  body: {
    data: {
      attributes: {
        accountTags: ["key:value"],
        authConfig: {
          roleName: "DatadogIntegrationRole",
        },
        awsAccountId: "123456789012",
        awsPartition: "aws",
        logsConfig: {
          lambdaForwarder: {
            lambdas: [
              "arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder",
            ],
            sources: ["s3"],
          },
        },
        metricsConfig: {
          automuteEnabled: true,
          collectCloudwatchAlarms: true,
          collectCustomMetrics: true,
          enabled: true,
          tagFilters: [
            {
              namespace: "AWS/EC2",
              tags: ["key:value"],
            },
          ],
        },
        resourcesConfig: {
          cloudSecurityPostureManagementCollection: false,
          extendedCollection: false,
        },
        tracesConfig: {},
      },
      type: "account",
    },
  },
};

apiInstance
  .createAWSAccount(params)
  .then((data: v2.AWSAccountResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
/**
 * Create an AWS integration returns "AWS Account object" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createAWSAccount"] = true;
const apiInstance = new v2.AWSIntegrationApi(configuration);

const params: v2.AWSIntegrationApiCreateAWSAccountRequest = {
  body: {
    data: {
      attributes: {
        accountTags: ["key:value"],
        authConfig: {
          accessKeyId: "AKIAIOSFODNN7EXAMPLE",
          secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
        },
        awsAccountId: "123456789012",
        awsPartition: "aws",
        logsConfig: {
          lambdaForwarder: {
            lambdas: [
              "arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder",
            ],
            sources: ["s3"],
          },
        },
        metricsConfig: {
          automuteEnabled: true,
          collectCloudwatchAlarms: true,
          collectCustomMetrics: true,
          enabled: true,
          tagFilters: [
            {
              namespace: "AWS/EC2",
              tags: ["key:value"],
            },
          ],
        },
        resourcesConfig: {
          cloudSecurityPostureManagementCollection: false,
          extendedCollection: false,
        },
        tracesConfig: {},
      },
      type: "account",
    },
  },
};

apiInstance
  .createAWSAccount(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 and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

Note: For the "v2" version of this endpoint, which is in beta, see Update an AWS integration v2.

PUT https://api.ap1.datadoghq.com/api/v1/integration/awshttps://api.datadoghq.eu/api/v1/integration/awshttps://api.ddog-gov.com/api/v1/integration/awshttps://api.datadoghq.com/api/v1/integration/awshttps://api.us3.datadoghq.com/api/v1/integration/awshttps://api.us5.datadoghq.com/api/v1/integration/aws

Présentation

Mettez à jour une intégration Datadog/Amazon Web Services. This endpoint requires the aws_configuration_edit permission.

Arguments

Chaînes de requête

Nom

Type

Description

account_id

string

Only return AWS accounts that matches this account_id.

role_name

string

Only return AWS accounts that match this role_name. Required if account_id is specified.

access_key_id

string

Only return AWS accounts that matches this access_key_id. Required if none of the other two options are specified.

Requête

Body Data (required)

Objet de requête AWS

Expand All

Champ

Type

Description

access_key_id

string

Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.

account_id

string

Your AWS Account ID without dashes.

account_specific_namespace_rules

object

An object, (in the form {"namespace1":true/false, "namespace2":true/false}), that enables or disables metric collection for specific AWS namespaces for this AWS account only.

<any-key>

boolean

A list of additional properties.

cspm_resource_collection_enabled

boolean

Whether Datadog collects cloud security posture management resources from your AWS account. This includes additional resources not covered under the general resource_collection.

excluded_regions

[string]

An array of AWS regions to exclude from metrics collection.

extended_resource_collection_enabled

boolean

Whether Datadog collects additional attributes and configuration information about the resources in your AWS account. Required for cspm_resource_collection.

filter_tags

[string]

The array of EC2 tags (in the form key:value) defines a filter that Datadog uses when collecting metrics from EC2. Wildcards, such as ? (for single characters) and * (for multiple characters) can also be used. Only hosts that match one of the defined tags will be imported into Datadog. The rest will be ignored. Host matching a given tag can also be excluded by adding ! before the tag. For example, env:production,instance-type:c1.*,!region:us-east-1

host_tags

[string]

Array of tags (in the form key:value) to add to all hosts and metrics reporting through this integration.

metrics_collection_enabled

boolean

Whether Datadog collects metrics for this AWS account.

default: true

resource_collection_enabled

boolean

DEPRECATED: Deprecated in favor of 'extended_resource_collection_enabled'. Whether Datadog collects a standard set of resources from your AWS account.

role_name

string

Your Datadog role delegation name.

secret_access_key

string

Your AWS secret access key. Only required if your AWS account is a GovCloud or China account.

{
  "account_id": "163662907100",
  "account_specific_namespace_rules": {
    "auto_scaling": false
  },
  "cspm_resource_collection_enabled": false,
  "excluded_regions": [
    "us-east-1",
    "us-west-2"
  ],
  "extended_resource_collection_enabled": true,
  "filter_tags": [
    "$KEY:$VALUE"
  ],
  "host_tags": [
    "$KEY:$VALUE"
  ],
  "metrics_collection_enabled": true,
  "role_name": "DatadogAWSIntegrationRole"
}

Réponse

OK

Expand All

Champ

Type

Description

No response body

{}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Conflict Error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

/**
 * Update an AWS integration returns "OK" response
 */

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

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

const params: v1.AWSIntegrationApiUpdateAWSAccountRequest = {
  body: {
    accountId: "163662907100",
    accountSpecificNamespaceRules: {
      auto_scaling: false,
    },
    cspmResourceCollectionEnabled: false,
    excludedRegions: ["us-east-1", "us-west-2"],
    extendedResourceCollectionEnabled: true,
    filterTags: ["$KEY:$VALUE"],
    hostTags: ["$KEY:$VALUE"],
    metricsCollectionEnabled: true,
    roleName: "DatadogAWSIntegrationRole",
  },
  accountId: "163662907100",
  roleName: "DatadogAWSIntegrationRole",
};

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

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

Note: This endpoint is in Preview. If you have any feedback, contact Datadog support.

PATCH https://api.ap1.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id}https://api.datadoghq.eu/api/v2/integration/aws/accounts/{aws_account_config_id}https://api.ddog-gov.com/api/v2/integration/aws/accounts/{aws_account_config_id}https://api.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id}https://api.us3.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id}https://api.us5.datadoghq.com/api/v2/integration/aws/accounts/{aws_account_config_id}

Présentation

Mettez à jour une intégration Datadog/Amazon Web Services. This endpoint requires the aws_configuration_edit permission.

Arguments

Paramètres du chemin

Nom

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 endpoint and query by AWS Account ID.

Requête

Body Data (required)

Objet de requête AWS

Expand All

Champ

Type

Description

data [required]

object

AWS Account Update Request data.

attributes [required]

object

The AWS Account Integration Config to be updated.

account_tags

[string]

Tags to apply to all hosts and metrics reporting for this account. Defaults to [].

auth_config

 <oneOf>

AWS Authentication config.

Option 1

object

AWS Authentication config to integrate your account using an access key pair.

access_key_id [required]

string

AWS Access Key ID.

secret_access_key

string

AWS Secret Access Key.

Option 2

object

AWS Authentication config to integrate your account using an IAM role.

external_id

string

AWS IAM External ID for associated role.

role_name [required]

string

AWS IAM Role name.

aws_account_id [required]

string

AWS Account ID.

aws_partition

enum

AWS partition your AWS account is scoped to. Defaults to aws. See Partitions in the AWS documentation for more information. Allowed enum values: aws,aws-cn,aws-us-gov

aws_regions

 <oneOf>

AWS Regions to collect data from. Defaults to include_all.

Option 1

object

Include all regions. Defaults to true.

include_all [required]

boolean

Include all regions.

Option 2

object

Include only these regions.

include_only [required]

[string]

Include only these regions.

logs_config

object

AWS Logs Collection 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.

lambdas

[string]

List of Datadog Lambda Log Forwarder ARNs in your AWS account. Defaults to [].

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 endpoint.

metrics_config

object

AWS Metrics Collection config.

automute_enabled

boolean

Enable EC2 automute for AWS metrics. Defaults to true.

collect_cloudwatch_alarms

boolean

Enable CloudWatch alarms collection. Defaults to false.

collect_custom_metrics

boolean

Enable custom metrics collection. Defaults to false.

enabled

boolean

Enable AWS metrics collection. Defaults to true.

namespace_filters

 <oneOf>

AWS Metrics namespace filters. Defaults to exclude_only.

Option 1

object

Exclude only these namespaces from metrics collection. Defaults to ["AWS/SQS", "AWS/ElasticMapReduce"]. AWS/SQS and AWS/ElasticMapReduce are excluded by default to reduce your AWS CloudWatch costs from GetMetricData API calls.

exclude_only [required]

[string]

Exclude only these namespaces from metrics collection. Defaults to ["AWS/SQS", "AWS/ElasticMapReduce"]. AWS/SQS and AWS/ElasticMapReduce are excluded by default to reduce your AWS CloudWatch costs from GetMetricData API calls.

Option 2

object

Include only these namespaces.

include_only [required]

[string]

Include only these namespaces.

tag_filters

[object]

AWS Metrics collection tag filters list. Defaults to [].

namespace

string

The AWS service for which the tag filters defined in tags will be applied.

tags

[string]

The AWS resource tags to filter on for the service specified by namespace.

resources_config

object

AWS Resources Collection 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.

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.

traces_config

object

AWS Traces Collection config.

xray_services

 <oneOf>

AWS X-Ray services to collect traces from. Defaults to include_only.

Option 1

object

Include all services.

include_all [required]

boolean

Include all services.

Option 2

object

Include only these services. Defaults to [].

include_only [required]

[string]

Include only these services.

id

string

Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the List all AWS integrations endpoint and query by AWS Account ID.

type [required]

enum

AWS Account resource type. Allowed enum values: account

default: account

{
  "data": {
    "attributes": {
      "account_tags": [
        "key:value"
      ],
      "auth_config": {
        "role_name": "DatadogIntegrationRole"
      },
      "aws_account_id": "123456789012",
      "aws_partition": "aws",
      "logs_config": {
        "lambda_forwarder": {
          "lambdas": [
            "arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"
          ],
          "sources": [
            "s3"
          ]
        }
      },
      "metrics_config": {
        "automute_enabled": true,
        "collect_cloudwatch_alarms": true,
        "collect_custom_metrics": true,
        "enabled": true,
        "tag_filters": [
          {
            "namespace": "AWS/EC2",
            "tags": [
              "key:value"
            ]
          }
        ]
      },
      "resources_config": {
        "cloud_security_posture_management_collection": false,
        "extended_collection": false
      },
      "traces_config": {}
    },
    "type": "account"
  }
}

Réponse

AWS Account object

AWS Account response body.

Expand All

Champ

Type

Description

data [required]

object

AWS Account response data.

attributes

object

AWS Account response attributes.

account_tags

[string]

Tags to apply to all hosts and metrics reporting for this account. Defaults to [].

auth_config

 <oneOf>

AWS Authentication config.

Option 1

object

AWS Authentication config to integrate your account using an access key pair.

access_key_id [required]

string

AWS Access Key ID.

secret_access_key

string

AWS Secret Access Key.

Option 2

object

AWS Authentication config to integrate your account using an IAM role.

external_id

string

AWS IAM External ID for associated role.

role_name [required]

string

AWS IAM Role name.

aws_account_id [required]

string

AWS Account ID.

aws_partition

enum

AWS partition your AWS account is scoped to. Defaults to aws. See Partitions in the AWS documentation for more information. Allowed enum values: aws,aws-cn,aws-us-gov

aws_regions

 <oneOf>

AWS Regions to collect data from. Defaults to include_all.

Option 1

object

Include all regions. Defaults to true.

include_all [required]

boolean

Include all regions.

Option 2

object

Include only these regions.

include_only [required]

[string]

Include only these regions.

created_at

date-time

Timestamp of when the account integration was created.

logs_config

object

AWS Logs Collection 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.

lambdas

[string]

List of Datadog Lambda Log Forwarder ARNs in your AWS account. Defaults to [].

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 endpoint.

metrics_config

object

AWS Metrics Collection config.

automute_enabled

boolean

Enable EC2 automute for AWS metrics. Defaults to true.

collect_cloudwatch_alarms

boolean

Enable CloudWatch alarms collection. Defaults to false.

collect_custom_metrics

boolean

Enable custom metrics collection. Defaults to false.

enabled

boolean

Enable AWS metrics collection. Defaults to true.

namespace_filters

 <oneOf>

AWS Metrics namespace filters. Defaults to exclude_only.

Option 1

object

Exclude only these namespaces from metrics collection. Defaults to ["AWS/SQS", "AWS/ElasticMapReduce"]. AWS/SQS and AWS/ElasticMapReduce are excluded by default to reduce your AWS CloudWatch costs from GetMetricData API calls.

exclude_only [required]

[string]

Exclude only these namespaces from metrics collection. Defaults to ["AWS/SQS", "AWS/ElasticMapReduce"]. AWS/SQS and AWS/ElasticMapReduce are excluded by default to reduce your AWS CloudWatch costs from GetMetricData API calls.

Option 2

object

Include only these namespaces.

include_only [required]

[string]

Include only these namespaces.

tag_filters

[object]

AWS Metrics collection tag filters list. Defaults to [].

namespace

string

The AWS service for which the tag filters defined in tags will be applied.

tags

[string]

The AWS resource tags to filter on for the service specified by namespace.

modified_at

date-time

Timestamp of when the account integration was updated.

resources_config

object

AWS Resources Collection 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.

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.

traces_config

object

AWS Traces Collection config.

xray_services

 <oneOf>

AWS X-Ray services to collect traces from. Defaults to include_only.

Option 1

object

Include all services.

include_all [required]

boolean

Include all services.

Option 2

object

Include only these services. Defaults to [].

include_only [required]

[string]

Include only these services.

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 endpoint and query by AWS Account ID.

type [required]

enum

AWS Account resource type. Allowed enum values: account

default: account

{
  "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"
          ],
          "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"
          ]
        },
        "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"
  }
}

Bad Request

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

/**
 * Update an AWS integration returns "AWS Account object" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateAWSAccount"] = true;
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.AWSIntegrationApiUpdateAWSAccountRequest = {
  body: {
    data: {
      attributes: {
        accountTags: ["key:value"],
        authConfig: {
          roleName: "DatadogIntegrationRole",
        },
        awsAccountId: "123456789012",
        awsPartition: "aws",
        logsConfig: {
          lambdaForwarder: {
            lambdas: [
              "arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder",
            ],
            sources: ["s3"],
          },
        },
        metricsConfig: {
          automuteEnabled: true,
          collectCloudwatchAlarms: true,
          collectCustomMetrics: true,
          enabled: true,
          tagFilters: [
            {
              namespace: "AWS/EC2",
              tags: ["key:value"],
            },
          ],
        },
        resourcesConfig: {
          cloudSecurityPostureManagementCollection: false,
          extendedCollection: false,
        },
        tracesConfig: {},
      },
      type: "account",
    },
  },
  awsAccountConfigId: AWS_ACCOUNT_V2_DATA_ID,
};

apiInstance
  .updateAWSAccount(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 and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

GET https://api.ap1.datadoghq.com/api/v1/integration/aws/event_bridgehttps://api.datadoghq.eu/api/v1/integration/aws/event_bridgehttps://api.ddog-gov.com/api/v1/integration/aws/event_bridgehttps://api.datadoghq.com/api/v1/integration/aws/event_bridgehttps://api.us3.datadoghq.com/api/v1/integration/aws/event_bridgehttps://api.us5.datadoghq.com/api/v1/integration/aws/event_bridge

Présentation

Get all Amazon EventBridge sources.

Réponse

OK

An object describing the EventBridge configuration for multiple accounts.

Expand All

Champ

Type

Description

accounts

[object]

List of accounts with their event sources.

accountId

string

Your AWS Account ID without dashes.

eventHubs

[object]

Array of AWS event sources associated with this account.

name

string

The event source name.

region

string

The event source's AWS region.

tags

[string]

Array of tags (in the form key:value) which are added to all hosts and metrics reporting through the main AWS integration.

isInstalled

boolean

True if the EventBridge sub-integration is enabled for your organization.

{
  "accounts": [
    {
      "accountId": "123456789012",
      "eventHubs": [
        {
          "name": "string",
          "region": "string"
        }
      ],
      "tags": [
        "$KEY:$VALUE"
      ]
    }
  ],
  "isInstalled": false
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

/**
 * Get all Amazon EventBridge sources returns "OK" response
 */

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

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

apiInstance
  .listAWSEventBridgeSources()
  .then((data: v1.AWSEventBridgeListResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v1/integration/aws/event_bridgehttps://api.datadoghq.eu/api/v1/integration/aws/event_bridgehttps://api.ddog-gov.com/api/v1/integration/aws/event_bridgehttps://api.datadoghq.com/api/v1/integration/aws/event_bridgehttps://api.us3.datadoghq.com/api/v1/integration/aws/event_bridgehttps://api.us5.datadoghq.com/api/v1/integration/aws/event_bridge

Présentation

Create an Amazon EventBridge source. This endpoint requires the manage_integrations permission.

Requête

Body Data (required)

Create an Amazon EventBridge source for an AWS account with a given name and region.

Expand All

Champ

Type

Description

account_id

string

Your AWS Account ID without dashes.

create_event_bus

boolean

True if Datadog should create the event bus in addition to the event source. Requires the events:CreateEventBus permission.

event_generator_name

string

The given part of the event source name, which is then combined with an assigned suffix to form the full name.

region

string

The event source's AWS region.

{
  "account_id": "123456789012",
  "create_event_bus": true,
  "event_generator_name": "app-alerts",
  "region": "us-east-1"
}

Réponse

OK

A created EventBridge source.

Expand All

Champ

Type

Description

event_source_name

string

The event source name.

has_bus

boolean

True if the event bus was created in addition to the source.

region

string

The event source's AWS region.

status

enum

The event source status "created". Allowed enum values: created

{
  "event_source_name": "app-alerts-zyxw3210",
  "has_bus": true,
  "region": "us-east-1",
  "status": "created"
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

/**
 * Create an Amazon EventBridge source returns "OK" response
 */

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

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

const params: v1.AWSIntegrationApiCreateAWSEventBridgeSourceRequest = {
  body: {
    accountId: "123456789012",
    createEventBus: true,
    eventGeneratorName: "app-alerts",
    region: "us-east-1",
  },
};

apiInstance
  .createAWSEventBridgeSource(params)
  .then((data: v1.AWSEventBridgeCreateResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

DELETE https://api.ap1.datadoghq.com/api/v1/integration/aws/event_bridgehttps://api.datadoghq.eu/api/v1/integration/aws/event_bridgehttps://api.ddog-gov.com/api/v1/integration/aws/event_bridgehttps://api.datadoghq.com/api/v1/integration/aws/event_bridgehttps://api.us3.datadoghq.com/api/v1/integration/aws/event_bridgehttps://api.us5.datadoghq.com/api/v1/integration/aws/event_bridge

Présentation

Delete an Amazon EventBridge source. This endpoint requires the manage_integrations permission.

Requête

Body Data (required)

Delete the Amazon EventBridge source with the given name, region, and associated AWS account.

Expand All

Champ

Type

Description

account_id

string

Your AWS Account ID without dashes.

event_generator_name

string

The event source name.

region

string

The event source's AWS region.

{
  "account_id": "123456789012",
  "event_generator_name": "app-alerts-zyxw3210",
  "region": "us-east-1"
}

Réponse

OK

An indicator of the successful deletion of an EventBridge source.

Expand All

Champ

Type

Description

status

enum

The event source status "empty". Allowed enum values: empty

{
  "status": "empty"
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

/**
 * Delete an Amazon EventBridge source returns "OK" response
 */

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

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

const params: v1.AWSIntegrationApiDeleteAWSEventBridgeSourceRequest = {
  body: {
    accountId: "123456789012",
    eventGeneratorName: "app-alerts-zyxw3210",
    region: "us-east-1",
  },
};

apiInstance
  .deleteAWSEventBridgeSource(params)
  .then((data: v1.AWSEventBridgeDeleteResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"