Configura tu integración AWS en Datadog directamente a través de la API Datadog.
Para obtener más información, consulta la página de la integración AWS.
"""
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));
Define un filtro de etiquetas de AWS.
This endpoint requires the aws_configuration_edit permission.
Solicitud
Body Data (required)
Define un filtros de etiquetas de AWS utilizando un identificador_de_cuenta_de_aws, un espacio de nombres y una cadena de filtrado.
Las opciones de espacio de nombres son application_elb, elb, lambda, network_elb, rds, sqs y personalizado.
"""
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));
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));
Enumera todas las reglas de espacios de nombres para una determinada integración AWS en Datadog. Este endpoint no recibe argumentos.
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));
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));
Elimina una integración AWS en Datadog que coincida con los parámetros especificados id_de_cuenta y nombre_de_rol.
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));
Crea una integración Amazon Web Services en Datadog.
El uso del método POST actualiza la configuración de tu integración
añadiendo tu nueva configuración a la existente en tu organización Datadog.
Único ID de cuenta de AWS para la autenticación basada en roles.
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));
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));
"""
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));