"""
Get all AWS tag filters returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.aws_integration_apiimportAWSIntegrationApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=AWSIntegrationApi(api_client)response=api_instance.list_aws_tag_filters(account_id="account_id",)print(response)
# Get all AWS tag filters returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::AWSIntegrationAPI.newpapi_instance.list_aws_tag_filters("account_id")
// Get all AWS tag filters returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewAWSIntegrationApi(apiClient)resp,r,err:=api.ListAWSTagFilters(ctx,"account_id")iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `AWSIntegrationApi.ListAWSTagFilters`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `AWSIntegrationApi.ListAWSTagFilters`:\n%s\n",responseContent)}
// Get all AWS tag filters returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.AwsIntegrationApi;importcom.datadog.api.client.v1.model.AWSTagFilterListResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();AwsIntegrationApiapiInstance=newAwsIntegrationApi(defaultClient);try{AWSTagFilterListResponseresult=apiInstance.listAWSTagFilters("account_id");System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling AwsIntegrationApi#listAWSTagFilters");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get all AWS tag filters returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=AWSIntegrationAPI::with_config(configuration);letresp=api.list_aws_tag_filters("account_id".to_string()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
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 all AWS tag filters returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSIntegrationApi(configuration);constparams: v1.AWSIntegrationApiListAWSTagFiltersRequest={accountId:"account_id",};apiInstance.listAWSTagFilters(params).then((data: v1.AWSTagFilterListResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Définissez un filtre de tags AWS.
This endpoint requires the aws_configuration_edit permission.
Requête
Body Data (required)
Définissez un filtre de tags AWS à l’aide d’un aws_account_identifier, d’un namespace et d’une chaîne de filtrage.
Les options d’espace de nommage sont application_elb, elb, lambda, network_elb, rds, sqs, et custom.
"""
Set an AWS tag filter returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.aws_integration_apiimportAWSIntegrationApifromdatadog_api_client.v1.model.aws_namespaceimportAWSNamespacefromdatadog_api_client.v1.model.aws_tag_filter_create_requestimportAWSTagFilterCreateRequestbody=AWSTagFilterCreateRequest(account_id="123456789012",namespace=AWSNamespace.ELB,tag_filter_str="prod*",)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=AWSIntegrationApi(api_client)response=api_instance.create_aws_tag_filter(body=body)print(response)
# Set an AWS tag filter returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::AWSIntegrationAPI.newbody=DatadogAPIClient::V1::AWSTagFilterCreateRequest.new({account_id:"123456789012",namespace:DatadogAPIClient::V1::AWSNamespace::ELB,tag_filter_str:"prod*",})papi_instance.create_aws_tag_filter(body)
// Set an AWS tag filter returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){body:=datadogV1.AWSTagFilterCreateRequest{AccountId:datadog.PtrString("123456789012"),Namespace:datadogV1.AWSNAMESPACE_ELB.Ptr(),TagFilterStr:datadog.PtrString("prod*"),}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewAWSIntegrationApi(apiClient)resp,r,err:=api.CreateAWSTagFilter(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `AWSIntegrationApi.CreateAWSTagFilter`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `AWSIntegrationApi.CreateAWSTagFilter`:\n%s\n",responseContent)}
// Set an AWS tag filter returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.AwsIntegrationApi;importcom.datadog.api.client.v1.model.AWSNamespace;importcom.datadog.api.client.v1.model.AWSTagFilterCreateRequest;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();AwsIntegrationApiapiInstance=newAwsIntegrationApi(defaultClient);AWSTagFilterCreateRequestbody=newAWSTagFilterCreateRequest().accountId("123456789012").namespace(AWSNamespace.ELB).tagFilterStr("prod*");try{apiInstance.createAWSTagFilter(body);}catch(ApiExceptione){System.err.println("Exception when calling AwsIntegrationApi#createAWSTagFilter");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Set an AWS tag filter returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;usedatadog_api_client::datadogV1::model::AWSNamespace;usedatadog_api_client::datadogV1::model::AWSTagFilterCreateRequest;#[tokio::main]asyncfnmain(){letbody=AWSTagFilterCreateRequest::new().account_id("123456789012".to_string()).namespace(AWSNamespace::ELB).tag_filter_str("prod*".to_string());letconfiguration=datadog::Configuration::new();letapi=AWSIntegrationAPI::with_config(configuration);letresp=api.create_aws_tag_filter(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
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
/**
* Set an AWS tag filter returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSIntegrationApi(configuration);constparams: v1.AWSIntegrationApiCreateAWSTagFilterRequest={body:{accountId:"123456789012",namespace:"elb",tagFilterStr:"prod*",},};apiInstance.createAWSTagFilter(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete a tag filtering entry returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.aws_integration_apiimportAWSIntegrationApifromdatadog_api_client.v1.model.aws_namespaceimportAWSNamespacefromdatadog_api_client.v1.model.aws_tag_filter_delete_requestimportAWSTagFilterDeleteRequestbody=AWSTagFilterDeleteRequest(account_id="FAKEAC0FAKEAC2FAKEAC",namespace=AWSNamespace.ELB,)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=AWSIntegrationApi(api_client)response=api_instance.delete_aws_tag_filter(body=body)print(response)
# Delete a tag filtering entry returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::AWSIntegrationAPI.newbody=DatadogAPIClient::V1::AWSTagFilterDeleteRequest.new({account_id:"FAKEAC0FAKEAC2FAKEAC",namespace:DatadogAPIClient::V1::AWSNamespace::ELB,})papi_instance.delete_aws_tag_filter(body)
// Delete a tag filtering entry returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){body:=datadogV1.AWSTagFilterDeleteRequest{AccountId:datadog.PtrString("FAKEAC0FAKEAC2FAKEAC"),Namespace:datadogV1.AWSNAMESPACE_ELB.Ptr(),}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewAWSIntegrationApi(apiClient)resp,r,err:=api.DeleteAWSTagFilter(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `AWSIntegrationApi.DeleteAWSTagFilter`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `AWSIntegrationApi.DeleteAWSTagFilter`:\n%s\n",responseContent)}
// Delete a tag filtering entry returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;usedatadog_api_client::datadogV1::model::AWSNamespace;usedatadog_api_client::datadogV1::model::AWSTagFilterDeleteRequest;#[tokio::main]asyncfnmain(){letbody=AWSTagFilterDeleteRequest::new().account_id("FAKEAC0FAKEAC2FAKEAC".to_string()).namespace(AWSNamespace::ELB);letconfiguration=datadog::Configuration::new();letapi=AWSIntegrationAPI::with_config(configuration);letresp=api.delete_aws_tag_filter(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
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 a tag filtering entry returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSIntegrationApi(configuration);constparams: v1.AWSIntegrationApiDeleteAWSTagFilterRequest={body:{accountId:"FAKEAC0FAKEAC2FAKEAC",namespace:"elb",},};apiInstance.deleteAWSTagFilter(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Get an AWS Account Integration Config by config ID.
This endpoint requires the aws_configuration_read permission.
Arguments
Paramètres du chemin
Nom
Type
Description
aws_account_config_id [required]
string
Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the
List all AWS integrations endpoint and query by AWS Account ID.
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
Include all regions. Defaults to true.
include_all [required]
boolean
Include all regions.
Option 2
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
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
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
Include all services.
include_all [required]
boolean
Include all services.
Option 2
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.
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.
"""
Generate a new external ID returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.aws_integration_apiimportAWSIntegrationApifromdatadog_api_client.v1.model.aws_accountimportAWSAccountbody=AWSAccount(account_id="123456789012",account_specific_namespace_rules=dict(auto_scaling=False,opswork=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",)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=AWSIntegrationApi(api_client)response=api_instance.create_new_aws_external_id(body=body)print(response)
# Generate a new external ID returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::AWSIntegrationAPI.newbody=DatadogAPIClient::V1::AWSAccount.new({account_id:"123456789012",account_specific_namespace_rules:{auto_scaling:false,opswork: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",})papi_instance.create_new_aws_external_id(body)
// Generate a new external ID returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){body:=datadogV1.AWSAccount{AccountId:datadog.PtrString("123456789012"),AccountSpecificNamespaceRules:map[string]bool{"auto_scaling":false,"opswork":false,},CspmResourceCollectionEnabled:datadog.PtrBool(true),ExcludedRegions:[]string{"us-east-1","us-west-2",},ExtendedResourceCollectionEnabled:datadog.PtrBool(true),FilterTags:[]string{"$KEY:$VALUE",},HostTags:[]string{"$KEY:$VALUE",},MetricsCollectionEnabled:datadog.PtrBool(false),ResourceCollectionEnabled:datadog.PtrBool(true),RoleName:datadog.PtrString("DatadogAWSIntegrationRole"),}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewAWSIntegrationApi(apiClient)resp,r,err:=api.CreateNewAWSExternalID(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `AWSIntegrationApi.CreateNewAWSExternalID`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `AWSIntegrationApi.CreateNewAWSExternalID`:\n%s\n",responseContent)}
// Generate a new external ID returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.AwsIntegrationApi;importcom.datadog.api.client.v1.model.AWSAccount;importcom.datadog.api.client.v1.model.AWSAccountCreateResponse;importjava.util.Arrays;importjava.util.Collections;importjava.util.Map;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();AwsIntegrationApiapiInstance=newAwsIntegrationApi(defaultClient);AWSAccountbody=newAWSAccount().accountId("123456789012").accountSpecificNamespaceRules(Map.ofEntries(Map.entry("auto_scaling",false),Map.entry("opswork",false))).cspmResourceCollectionEnabled(true).excludedRegions(Arrays.asList("us-east-1","us-west-2")).extendedResourceCollectionEnabled(true).filterTags(Collections.singletonList("$KEY:$VALUE")).hostTags(Collections.singletonList("$KEY:$VALUE")).metricsCollectionEnabled(false).resourceCollectionEnabled(true).roleName("DatadogAWSIntegrationRole");try{AWSAccountCreateResponseresult=apiInstance.createNewAWSExternalID(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling AwsIntegrationApi#createNewAWSExternalID");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Generate a new external ID returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;usedatadog_api_client::datadogV1::model::AWSAccount;usestd::collections::BTreeMap;#[tokio::main]asyncfnmain(){letbody=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());letconfiguration=datadog::Configuration::new();letapi=AWSIntegrationAPI::with_config(configuration);letresp=api.create_new_aws_external_id(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
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
/**
* Generate a new external ID returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSIntegrationApi(configuration);constparams: v1.AWSIntegrationApiCreateNewAWSExternalIDRequest={body:{accountId:"123456789012",accountSpecificNamespaceRules:{auto_scaling: false,opswork: false,},cspmResourceCollectionEnabled: true,excludedRegions:["us-east-1","us-west-2"],extendedResourceCollectionEnabled: true,filterTags:["$KEY:$VALUE"],hostTags:["$KEY:$VALUE"],metricsCollectionEnabled: false,resourceCollectionEnabled: true,roleName:"DatadogAWSIntegrationRole",},};apiInstance.createNewAWSExternalID(params).then((data: v1.AWSAccountCreateResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Énumérez toutes les règles d’espace de nommage pour une intégration Datadog/AWS donnée. Cet endpoint ne prend aucun argument.
This endpoint requires the aws_configuration_read permission.
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
/**
* List namespace rules returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSIntegrationApi(configuration);apiInstance.listAvailableAWSNamespaces().then((data: string[])=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Énumérez toutes les intégrations Datadog/AWS disponibles au sein de votre organisation Datadog.
This endpoint requires the aws_configuration_read permission.
Arguments
Chaînes de requête
Nom
Type
Description
account_id
string
Only return AWS accounts that matches this account_id.
role_name
string
Only return AWS accounts that matches this role_name.
access_key_id
string
Only return AWS accounts that matches this access_key_id.
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.
"""
List all AWS integrations returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.aws_integration_apiimportAWSIntegrationApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=AWSIntegrationApi(api_client)response=api_instance.list_aws_accounts()print(response)
# List all AWS integrations returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::AWSIntegrationAPI.newpapi_instance.list_aws_accounts()
// List all AWS integrations returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewAWSIntegrationApi(apiClient)resp,r,err:=api.ListAWSAccounts(ctx,*datadogV1.NewListAWSAccountsOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `AWSIntegrationApi.ListAWSAccounts`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `AWSIntegrationApi.ListAWSAccounts`:\n%s\n",responseContent)}
// List all AWS integrations returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;usedatadog_api_client::datadogV1::api_aws_integration::ListAWSAccountsOptionalParams;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=AWSIntegrationAPI::with_config(configuration);letresp=api.list_aws_accounts(ListAWSAccountsOptionalParams::default()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
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
/**
* List all AWS integrations returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSIntegrationApi(configuration);apiInstance.listAWSAccounts().then((data: v1.AWSAccountListResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Énumérez toutes les intégrations Datadog/AWS disponibles au sein de votre organisation Datadog.
This endpoint requires the aws_configuration_read permission.
Arguments
Chaînes de requête
Nom
Type
Description
aws_account_id
string
Optional query parameter to filter accounts by AWS Account ID. If not provided, all accounts are returned.
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
Include all regions. Defaults to true.
include_all [required]
boolean
Include all regions.
Option 2
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
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
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
Include all services.
include_all [required]
boolean
Include all services.
Option 2
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.
Supprimez une intégration Datadog/AWS correspondant aux valeurs account_id et role_name parameters indiquées.
This endpoint requires the aws_configurations_manage permission.
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 an AWS integration returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSIntegrationApi(configuration);constparams: v1.AWSIntegrationApiDeleteAWSAccountRequest={body:{accountId:"163662907100",roleName:"DatadogAWSIntegrationRole",},};apiInstance.deleteAWSAccount(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Supprimez une intégration Datadog/AWS correspondant aux valeurs account_id et role_name parameters indiquées.
This endpoint requires the aws_configurations_manage permission.
Arguments
Paramètres du chemin
Nom
Type
Description
aws_account_config_id [required]
string
Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the
List all AWS integrations endpoint and query by AWS Account ID.
Créez une intégration Datadog/Amazon Web Services. La méthode POST permet de mettre à jour la configuration de votre intégration en ajoutant votre nouvelle configuration à celle de votre organisation Datadog. Un identifiant de compte AWS unique pour l’authentification basée sur les rôles.
This endpoint requires the aws_configurations_manage permission.
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.
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
/**
* Create an AWS integration returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSIntegrationApi(configuration);constparams: v1.AWSIntegrationApiCreateAWSAccountRequest={body:{accountId:"163662907100",accountSpecificNamespaceRules:{auto_scaling: false,},cspmResourceCollectionEnabled: true,excludedRegions:["us-east-1","us-west-2"],extendedResourceCollectionEnabled: true,filterTags:["$KEY:$VALUE"],hostTags:["$KEY:$VALUE"],metricsCollectionEnabled: false,roleName:"DatadogAWSIntegrationRole",},};apiInstance.createAWSAccount(params).then((data: v1.AWSAccountCreateResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Créez une intégration Datadog/Amazon Web Services. La méthode POST permet de mettre à jour la configuration de votre intégration en ajoutant votre nouvelle configuration à celle de votre organisation Datadog. Un identifiant de compte AWS unique pour l’authentification basée sur les rôles.
This endpoint requires the aws_configurations_manage permission.
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
Include all regions. Defaults to true.
include_all [required]
boolean
Include all regions.
Option 2
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
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
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.
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
Include all regions. Defaults to true.
include_all [required]
boolean
Include all regions.
Option 2
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
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
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
Include all services.
include_all [required]
boolean
Include all services.
Option 2
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.
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.
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
/**
* Update an AWS integration returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSIntegrationApi(configuration);constparams: v1.AWSIntegrationApiUpdateAWSAccountRequest={body:{accountId:"163662907100",accountSpecificNamespaceRules:{auto_scaling: false,},cspmResourceCollectionEnabled: false,excludedRegions:["us-east-1","us-west-2"],extendedResourceCollectionEnabled: true,filterTags:["$KEY:$VALUE"],hostTags:["$KEY:$VALUE"],metricsCollectionEnabled: true,roleName:"DatadogAWSIntegrationRole",},accountId:"163662907100",roleName:"DatadogAWSIntegrationRole",};apiInstance.updateAWSAccount(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Mettez à jour une intégration Datadog/Amazon Web Services.
This endpoint requires the aws_configuration_edit permission.
Arguments
Paramètres du chemin
Nom
Type
Description
aws_account_config_id [required]
string
Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the
List all AWS integrations endpoint and query by AWS Account ID.
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
Include all regions. Defaults to true.
include_all [required]
boolean
Include all regions.
Option 2
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
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
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
Include all services.
include_all [required]
boolean
Include all services.
Option 2
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.
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
Include all regions. Defaults to true.
include_all [required]
boolean
Include all regions.
Option 2
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
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
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
Include all services.
include_all [required]
boolean
Include all services.
Option 2
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.
"""
Get all Amazon EventBridge sources returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.aws_integration_apiimportAWSIntegrationApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=AWSIntegrationApi(api_client)response=api_instance.list_aws_event_bridge_sources()print(response)
# Get all Amazon EventBridge sources returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::AWSIntegrationAPI.newpapi_instance.list_aws_event_bridge_sources()
// Get all Amazon EventBridge sources returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewAWSIntegrationApi(apiClient)resp,r,err:=api.ListAWSEventBridgeSources(ctx)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `AWSIntegrationApi.ListAWSEventBridgeSources`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `AWSIntegrationApi.ListAWSEventBridgeSources`:\n%s\n",responseContent)}
// Get all Amazon EventBridge sources returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=AWSIntegrationAPI::with_config(configuration);letresp=api.list_aws_event_bridge_sources().await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
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 all Amazon EventBridge sources returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSIntegrationApi(configuration);apiInstance.listAWSEventBridgeSources().then((data: v1.AWSEventBridgeListResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
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
/**
* Create an Amazon EventBridge source returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSIntegrationApi(configuration);constparams: v1.AWSIntegrationApiCreateAWSEventBridgeSourceRequest={body:{accountId:"123456789012",createEventBus: true,eventGeneratorName:"app-alerts",region:"us-east-1",},};apiInstance.createAWSEventBridgeSource(params).then((data: v1.AWSEventBridgeCreateResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
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 an Amazon EventBridge source returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSIntegrationApi(configuration);constparams: v1.AWSIntegrationApiDeleteAWSEventBridgeSourceRequest={body:{accountId:"123456789012",eventGeneratorName:"app-alerts-zyxw3210",region:"us-east-1",},};apiInstance.deleteAWSEventBridgeSource(params).then((data: v1.AWSEventBridgeDeleteResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));