AWS 통합

Datadog API를 통해 바로 Datadog-AWS 통합을 구성하세요. 자세한 정보는 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

개요

Get all AWS tag filters. This endpoint requires the aws_configuration_read permission.

인수

쿼리 문자열

이름

유형

설명

account_id [required]

string

Only return AWS filters that matches this account_id.

응답

OK

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

Expand All

항목

유형

설명

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

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// Get all AWS tag filters returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.list_aws_tag_filters("account_id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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

개요

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

응답

AWS Namespaces List object

AWS Namespaces response body.

Expand All

항목

유형

설명

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

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

코드 사례

// List available namespaces returns "AWS Namespaces List object" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_aws_integration::AWSIntegrationAPI;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListAWSNamespaces", true);
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.list_aws_namespaces().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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

개요

Set an AWS tag filter. This endpoint requires the aws_configuration_edit permission.

요청

Body Data (required)

Set an AWS tag filter using an aws_account_identifier, namespace, and filtering string. Namespace options are application_elb, elb, lambda, network_elb, rds, sqs, and custom.

Expand All

항목

유형

설명

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*"
}

응답

OK

Expand All

항목

유형

설명

No response body

{}

Bad Request

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// Set an AWS tag filter returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV1::model::AWSNamespace;
use datadog_api_client::datadogV1::model::AWSTagFilterCreateRequest;

#[tokio::main]
async fn main() {
    let body = AWSTagFilterCreateRequest::new()
        .account_id("123456789012".to_string())
        .namespace(AWSNamespace::ELB)
        .tag_filter_str("prod*".to_string());
    let configuration = datadog::Configuration::new();
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.create_aws_tag_filter(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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

개요

Delete a tag filtering entry. This endpoint requires the aws_configuration_edit permission.

요청

Body Data (required)

Delete a tag filtering entry for a given AWS account and dd-aws namespace.

Expand All

항목

유형

설명

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"
}

응답

OK

Expand All

항목

유형

설명

No response body

{}

Bad Request

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// Delete a tag filtering entry returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV1::model::AWSNamespace;
use datadog_api_client::datadogV1::model::AWSTagFilterDeleteRequest;

#[tokio::main]
async fn main() {
    let body = AWSTagFilterDeleteRequest::new()
        .account_id("FAKEAC0FAKEAC2FAKEAC".to_string())
        .namespace(AWSNamespace::ELB);
    let configuration = datadog::Configuration::new();
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.delete_aws_tag_filter(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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}

개요

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

인수

경로 파라미터

이름

유형

설명

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.

응답

AWS Account object

AWS Account response body.

Expand All

항목

유형

설명

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

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

코드 사례

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

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

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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

개요

Generate a new AWS external ID for a given AWS account ID and role name pair. This endpoint requires the aws_configuration_edit permission.

요청

Body Data (required)

Your Datadog role delegation name. For more information about your AWS account Role name, see the Datadog AWS integration configuration info.

Expand All

항목

유형

설명

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"
}

응답

OK

The Response returned by the AWS Create Account call.

Expand All

항목

유형

설명

external_id

string

AWS external_id.

{
  "external_id": "string"
}

Bad Request

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// Generate a new external ID returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV1::model::AWSAccount;
use std::collections::BTreeMap;

#[tokio::main]
async fn main() {
    let body = AWSAccount::new()
        .account_id("123456789012".to_string())
        .account_specific_namespace_rules(BTreeMap::from([
            ("auto_scaling".to_string(), false),
            ("opswork".to_string(), false),
        ]))
        .cspm_resource_collection_enabled(true)
        .excluded_regions(vec!["us-east-1".to_string(), "us-west-2".to_string()])
        .extended_resource_collection_enabled(true)
        .filter_tags(vec!["$KEY:$VALUE".to_string()])
        .host_tags(vec!["$KEY:$VALUE".to_string()])
        .metrics_collection_enabled(false)
        .resource_collection_enabled(true)
        .role_name("DatadogAWSIntegrationRole".to_string());
    let configuration = datadog::Configuration::new();
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.create_new_aws_external_id(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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

개요

Generate a new external ID for AWS role-based authentication. This endpoint requires the aws_configuration_edit permission.

응답

AWS External ID object

AWS External ID response body.

Expand All

항목

유형

설명

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

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

코드 사례

// Generate a new external ID returns "AWS External ID object" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_aws_integration::AWSIntegrationAPI;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateNewAWSExternalID", true);
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.create_new_aws_external_id().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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

개요

List all namespace rules for a given Datadog-AWS integration. This endpoint takes no arguments. This endpoint requires the aws_configuration_read permission.

응답

OK

Expand All

항목

유형

설명

string

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

Authentication Error

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// List namespace rules returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.list_available_aws_namespaces().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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

개요

List all Datadog-AWS integrations available in your Datadog organization. This endpoint requires the aws_configuration_read permission.

인수

쿼리 문자열

이름

유형

설명

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.

응답

OK

List of enabled AWS accounts.

Expand All

항목

유형

설명

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

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// List all AWS integrations returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV1::api_aws_integration::ListAWSAccountsOptionalParams;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api
        .list_aws_accounts(ListAWSAccountsOptionalParams::default())
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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

개요

Get a list of AWS Account Integration Configs. This endpoint requires the aws_configuration_read permission.

인수

쿼리 문자열

이름

유형

설명

aws_account_id

string

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

응답

AWS Accounts List object

AWS Accounts response body.

Expand All

항목

유형

설명

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

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

코드 사례

// List all AWS integrations returns "AWS Accounts List object" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV2::api_aws_integration::ListAWSAccountsOptionalParams;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListAWSAccounts", true);
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api
        .list_aws_accounts(ListAWSAccountsOptionalParams::default())
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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

개요

Delete a Datadog-AWS integration matching the specified account_id and role_name parameters. This endpoint requires the aws_configurations_manage permission.

요청

Body Data (required)

AWS request object

Expand All

항목

유형

설명

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"
}

응답

OK

Expand All

항목

유형

설명

No response body

{}

Bad Request

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Conflict Error

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// Delete an AWS integration returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV1::model::AWSAccountDeleteRequest;

#[tokio::main]
async fn main() {
    let body = AWSAccountDeleteRequest::new()
        .account_id("163662907100".to_string())
        .role_name("DatadogAWSIntegrationRole".to_string());
    let configuration = datadog::Configuration::new();
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.delete_aws_account(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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}

개요

Delete an AWS Account Integration Config by config ID. This endpoint requires the aws_configurations_manage permission.

인수

경로 파라미터

이름

유형

설명

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.

응답

No Content

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

코드 사례

// Delete an AWS integration returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_aws_integration::AWSIntegrationAPI;

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

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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

개요

Create a Datadog-Amazon Web Services integration. Using the POST method updates your integration configuration by adding your new configuration to the existing one in your Datadog organization. A unique AWS Account ID for role based authentication. This endpoint requires the aws_configurations_manage permission.

요청

Body Data (required)

AWS Request Object

Expand All

항목

유형

설명

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"
}

응답

OK

The Response returned by the AWS Create Account call.

Expand All

항목

유형

설명

external_id

string

AWS external_id.

{
  "external_id": "string"
}

Bad Request

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Conflict Error

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// Create an AWS integration returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV1::model::AWSAccount;
use std::collections::BTreeMap;

#[tokio::main]
async fn main() {
    let body = AWSAccount::new()
        .account_id("163662907100".to_string())
        .account_specific_namespace_rules(BTreeMap::from([("auto_scaling".to_string(), false)]))
        .cspm_resource_collection_enabled(true)
        .excluded_regions(vec!["us-east-1".to_string(), "us-west-2".to_string()])
        .extended_resource_collection_enabled(true)
        .filter_tags(vec!["$KEY:$VALUE".to_string()])
        .host_tags(vec!["$KEY:$VALUE".to_string()])
        .metrics_collection_enabled(false)
        .role_name("DatadogAWSIntegrationRole".to_string());
    let configuration = datadog::Configuration::new();
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.create_aws_account(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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

개요

Create a new AWS Account Integration Config. This endpoint requires the aws_configurations_manage permission.

요청

Body Data (required)

Expand All

항목

유형

설명

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"
  }
}

응답

AWS Account object

AWS Account response body.

Expand All

항목

유형

설명

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

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Conflict

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

코드 사례

// Create an AWS account returns "AWS Account object" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV2::model::AWSAccountCreateRequest;
use datadog_api_client::datadogV2::model::AWSAccountCreateRequestAttributes;
use datadog_api_client::datadogV2::model::AWSAccountCreateRequestData;
use datadog_api_client::datadogV2::model::AWSAccountPartition;
use datadog_api_client::datadogV2::model::AWSAccountType;
use datadog_api_client::datadogV2::model::AWSAuthConfig;
use datadog_api_client::datadogV2::model::AWSAuthConfigRole;
use datadog_api_client::datadogV2::model::AWSLambdaForwarderConfig;
use datadog_api_client::datadogV2::model::AWSLogsConfig;
use datadog_api_client::datadogV2::model::AWSMetricsConfig;
use datadog_api_client::datadogV2::model::AWSNamespaceTagFilter;
use datadog_api_client::datadogV2::model::AWSResourcesConfig;
use datadog_api_client::datadogV2::model::AWSTracesConfig;

#[tokio::main]
async fn main() {
    let body = AWSAccountCreateRequest::new(AWSAccountCreateRequestData::new(
        AWSAccountCreateRequestAttributes::new(
            AWSAuthConfig::AWSAuthConfigRole(Box::new(AWSAuthConfigRole::new(
                "DatadogIntegrationRole".to_string(),
            ))),
            "123456789012".to_string(),
            AWSAccountPartition::AWS,
        )
        .account_tags(Some(vec!["key:value".to_string()]))
        .logs_config(
            AWSLogsConfig::new().lambda_forwarder(
                AWSLambdaForwarderConfig::new()
                    .lambdas(vec![
                        "arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"
                            .to_string(),
                    ])
                    .sources(vec!["s3".to_string()]),
            ),
        )
        .metrics_config(
            AWSMetricsConfig::new()
                .automute_enabled(true)
                .collect_cloudwatch_alarms(true)
                .collect_custom_metrics(true)
                .enabled(true)
                .tag_filters(vec![AWSNamespaceTagFilter::new()
                    .namespace("AWS/EC2".to_string())
                    .tags(Some(vec!["key:value".to_string()]))]),
        )
        .resources_config(
            AWSResourcesConfig::new()
                .cloud_security_posture_management_collection(false)
                .extended_collection(false),
        )
        .traces_config(AWSTracesConfig::new()),
        AWSAccountType::ACCOUNT,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateAWSAccount", true);
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.create_aws_account(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
// Create an AWS integration returns "AWS Account object" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV2::model::AWSAccountCreateRequest;
use datadog_api_client::datadogV2::model::AWSAccountCreateRequestAttributes;
use datadog_api_client::datadogV2::model::AWSAccountCreateRequestData;
use datadog_api_client::datadogV2::model::AWSAccountPartition;
use datadog_api_client::datadogV2::model::AWSAccountType;
use datadog_api_client::datadogV2::model::AWSAuthConfig;
use datadog_api_client::datadogV2::model::AWSAuthConfigKeys;
use datadog_api_client::datadogV2::model::AWSLambdaForwarderConfig;
use datadog_api_client::datadogV2::model::AWSLogsConfig;
use datadog_api_client::datadogV2::model::AWSMetricsConfig;
use datadog_api_client::datadogV2::model::AWSNamespaceTagFilter;
use datadog_api_client::datadogV2::model::AWSResourcesConfig;
use datadog_api_client::datadogV2::model::AWSTracesConfig;

#[tokio::main]
async fn main() {
    let body = AWSAccountCreateRequest::new(AWSAccountCreateRequestData::new(
        AWSAccountCreateRequestAttributes::new(
            AWSAuthConfig::AWSAuthConfigKeys(Box::new(
                AWSAuthConfigKeys::new("AKIAIOSFODNN7EXAMPLE".to_string())
                    .secret_access_key("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY".to_string()),
            )),
            "123456789012".to_string(),
            AWSAccountPartition::AWS,
        )
        .account_tags(Some(vec!["key:value".to_string()]))
        .logs_config(
            AWSLogsConfig::new().lambda_forwarder(
                AWSLambdaForwarderConfig::new()
                    .lambdas(vec![
                        "arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"
                            .to_string(),
                    ])
                    .sources(vec!["s3".to_string()]),
            ),
        )
        .metrics_config(
            AWSMetricsConfig::new()
                .automute_enabled(true)
                .collect_cloudwatch_alarms(true)
                .collect_custom_metrics(true)
                .enabled(true)
                .tag_filters(vec![AWSNamespaceTagFilter::new()
                    .namespace("AWS/EC2".to_string())
                    .tags(Some(vec!["key:value".to_string()]))]),
        )
        .resources_config(
            AWSResourcesConfig::new()
                .cloud_security_posture_management_collection(false)
                .extended_collection(false),
        )
        .traces_config(AWSTracesConfig::new()),
        AWSAccountType::ACCOUNT,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateAWSAccount", true);
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.create_aws_account(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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

개요

Update a Datadog-Amazon Web Services integration. This endpoint requires the aws_configuration_edit permission.

인수

쿼리 문자열

이름

유형

설명

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.

요청

Body Data (required)

AWS request object

Expand All

항목

유형

설명

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"
}

응답

OK

Expand All

항목

유형

설명

No response body

{}

Bad Request

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Conflict Error

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// Update an AWS integration returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV1::api_aws_integration::UpdateAWSAccountOptionalParams;
use datadog_api_client::datadogV1::model::AWSAccount;
use std::collections::BTreeMap;

#[tokio::main]
async fn main() {
    let body = AWSAccount::new()
        .account_id("163662907100".to_string())
        .account_specific_namespace_rules(BTreeMap::from([("auto_scaling".to_string(), false)]))
        .cspm_resource_collection_enabled(false)
        .excluded_regions(vec!["us-east-1".to_string(), "us-west-2".to_string()])
        .extended_resource_collection_enabled(true)
        .filter_tags(vec!["$KEY:$VALUE".to_string()])
        .host_tags(vec!["$KEY:$VALUE".to_string()])
        .metrics_collection_enabled(true)
        .role_name("DatadogAWSIntegrationRole".to_string());
    let configuration = datadog::Configuration::new();
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api
        .update_aws_account(
            body,
            UpdateAWSAccountOptionalParams::default()
                .account_id("163662907100".to_string())
                .role_name("DatadogAWSIntegrationRole".to_string()),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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}

개요

Update an AWS Account Integration Config by config ID. This endpoint requires the aws_configuration_edit permission.

인수

경로 파라미터

이름

유형

설명

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.

요청

Body Data (required)

Expand All

항목

유형

설명

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"
  }
}

응답

AWS Account object

AWS Account response body.

Expand All

항목

유형

설명

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

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

코드 사례

// Update an AWS integration returns "AWS Account object" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV2::model::AWSAccountPartition;
use datadog_api_client::datadogV2::model::AWSAccountType;
use datadog_api_client::datadogV2::model::AWSAccountUpdateRequest;
use datadog_api_client::datadogV2::model::AWSAccountUpdateRequestAttributes;
use datadog_api_client::datadogV2::model::AWSAccountUpdateRequestData;
use datadog_api_client::datadogV2::model::AWSAuthConfig;
use datadog_api_client::datadogV2::model::AWSAuthConfigRole;
use datadog_api_client::datadogV2::model::AWSLambdaForwarderConfig;
use datadog_api_client::datadogV2::model::AWSLogsConfig;
use datadog_api_client::datadogV2::model::AWSMetricsConfig;
use datadog_api_client::datadogV2::model::AWSNamespaceTagFilter;
use datadog_api_client::datadogV2::model::AWSResourcesConfig;
use datadog_api_client::datadogV2::model::AWSTracesConfig;

#[tokio::main]
async fn main() {
    // there is a valid "aws_account_v2" in the system
    let aws_account_v2_data_id = std::env::var("AWS_ACCOUNT_V2_DATA_ID").unwrap();
    let body =
        AWSAccountUpdateRequest::new(
            AWSAccountUpdateRequestData::new(
                AWSAccountUpdateRequestAttributes::new("123456789012".to_string())
                    .account_tags(Some(vec!["key:value".to_string()]))
                    .auth_config(
                        AWSAuthConfig::AWSAuthConfigRole(
                            Box::new(AWSAuthConfigRole::new("DatadogIntegrationRole".to_string())),
                        ),
                    )
                    .aws_partition(AWSAccountPartition::AWS)
                    .logs_config(
                        AWSLogsConfig
                        ::new().lambda_forwarder(
                            AWSLambdaForwarderConfig::new()
                                .lambdas(
                                    vec![
                                        "arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder".to_string()
                                    ],
                                )
                                .sources(vec!["s3".to_string()]),
                        ),
                    )
                    .metrics_config(
                        AWSMetricsConfig::new()
                            .automute_enabled(true)
                            .collect_cloudwatch_alarms(true)
                            .collect_custom_metrics(true)
                            .enabled(true)
                            .tag_filters(
                                vec![
                                    AWSNamespaceTagFilter::new()
                                        .namespace("AWS/EC2".to_string())
                                        .tags(Some(vec!["key:value".to_string()]))
                                ],
                            ),
                    )
                    .resources_config(
                        AWSResourcesConfig::new()
                            .cloud_security_posture_management_collection(false)
                            .extended_collection(false),
                    )
                    .traces_config(AWSTracesConfig::new()),
                AWSAccountType::ACCOUNT,
            ),
        );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateAWSAccount", true);
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api
        .update_aws_account(aws_account_v2_data_id.clone(), body)
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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

개요

Get all Amazon EventBridge sources.

응답

OK

An object describing the EventBridge configuration for multiple accounts.

Expand All

항목

유형

설명

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

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// Get all Amazon EventBridge sources returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.list_aws_event_bridge_sources().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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

개요

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

요청

Body Data (required)

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

Expand All

항목

유형

설명

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"
}

응답

OK

A created EventBridge source.

Expand All

항목

유형

설명

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

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// Create an Amazon EventBridge source returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV1::model::AWSEventBridgeCreateRequest;

#[tokio::main]
async fn main() {
    let body = AWSEventBridgeCreateRequest::new()
        .account_id("123456789012".to_string())
        .create_event_bus(true)
        .event_generator_name("app-alerts".to_string())
        .region("us-east-1".to_string());
    let configuration = datadog::Configuration::new();
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.create_aws_event_bridge_source(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run

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

개요

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

요청

Body Data (required)

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

Expand All

항목

유형

설명

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"
}

응답

OK

An indicator of the successful deletion of an EventBridge source.

Expand All

항목

유형

설명

status

enum

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

{
  "status": "empty"
}

Bad Request

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Authentication Error

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// Delete an Amazon EventBridge source returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV1::model::AWSEventBridgeDeleteRequest;

#[tokio::main]
async fn main() {
    let body = AWSEventBridgeDeleteRequest::new()
        .account_id("123456789012".to_string())
        .event_generator_name("app-alerts-zyxw3210".to_string())
        .region("us-east-1".to_string());
    let configuration = datadog::Configuration::new();
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.delete_aws_event_bridge_source(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs 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>" cargo run