"""
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" response
importcom.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
*/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));
Set an AWS tag filter using an aws_account_identifier, namespace, and filtering string.
Namespace options are application_elb, elb, lambda, network_elb, rds, sqs, and custom.
"""
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="1234567",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:"1234567",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("1234567"),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" response
importcom.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("1234567").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
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSIntegrationApi(configuration);constparams: v1.AWSIntegrationApiCreateAWSTagFilterRequest={body:{accountId:"1234567",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
*/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.
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.
resource_collection_enabled
boolean
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="1234567",account_specific_namespace_rules=dict(auto_scaling=False,opswork=False,),cspm_resource_collection_enabled=True,excluded_regions=["us-east-1","us-west-2",],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:"1234567",account_specific_namespace_rules:{auto_scaling:false,opswork:false,},cspm_resource_collection_enabled:true,excluded_regions:["us-east-1","us-west-2",],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("1234567"),AccountSpecificNamespaceRules:map[string]bool{"auto_scaling":false,"opswork":false,},CspmResourceCollectionEnabled:datadog.PtrBool(true),ExcludedRegions:[]string{"us-east-1","us-west-2",},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" response
importcom.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("1234567").accountSpecificNamespaceRules(Map.ofEntries(Map.entry("auto_scaling",false),Map.entry("opswork",false))).cspmResourceCollectionEnabled(true).excludedRegions(Arrays.asList("us-east-1","us-west-2")).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
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSIntegrationApi(configuration);constparams: v1.AWSIntegrationApiCreateNewAWSExternalIDRequest={body:{accountId:"1234567",accountSpecificNamespaceRules:{auto_scaling: false,opswork: false,},cspmResourceCollectionEnabled: true,excludedRegions:["us-east-1","us-west-2"],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));
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.
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.
resource_collection_enabled
boolean
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
*/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));
// 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)}
Create a Datadog-Amazon Web Services integration.
Using the POST method updates your integration configuration
by adding your new configuration to the existing one in your Datadog organization.
A unique AWS Account ID for role based authentication.
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.
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.
resource_collection_enabled
boolean
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.
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.
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.
resource_collection_enabled
boolean
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.