Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .generated-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"spec_repo_commit": "fd3370f",
"generated": "2025-08-06 20:54:19.208"
"spec_repo_commit": "c5cca50",
"generated": "2025-08-07 18:03:26.051"
}
40 changes: 40 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,8 @@ components:
example: arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder
type: string
type: array
log_source_config:
$ref: '#/components/schemas/AWSLambdaForwarderConfigLogSourceConfig'
sources:
description: 'List of service IDs set to enable automatic log collection.
Discover the list of available services with the
Expand All @@ -1636,6 +1638,44 @@ components:
type: string
type: array
type: object
AWSLambdaForwarderConfigLogSourceConfig:
description: Log source configuration.
properties:
tag_filters:
description: List of AWS log source tag filters. Defaults to `[]`.
items:
$ref: '#/components/schemas/AWSLogSourceTagFilter'
type: array
type: object
AWSLogSourceTagFilter:
description: 'AWS log source tag filter list. Defaults to `[]`.

Array of log source to AWS resource tag mappings. Each mapping contains a
log source and its associated AWS resource tags (in `key:value` format) used
to filter logs submitted to Datadog.

Tag filters are applied for tags on the AWS resource emitting logs; tags associated
with the log storage entity (such as a CloudWatch Log Group or S3 Bucket)
are not considered.

For more information on resource tag filter syntax, [see AWS resource exclusion](https://docs.datadoghq.com/account_management/billing/aws/#aws-resource-exclusion)
in the AWS integration billing page.'
properties:
source:
description: The AWS log source to which the tag filters defined in `tags`
are applied.
example: s3
type: string
tags:
description: The AWS resource tags to filter on for the log source specified
by `source`.
items:
description: Tag in the form `key:value`.
example: env:prod
type: string
nullable: true
type: array
type: object
AWSLogsConfig:
description: AWS Logs Collection config.
properties:
Expand Down
14 changes: 14 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,20 @@ datadog\_api\_client.v2.model.aws\_lambda\_forwarder\_config module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.aws\_lambda\_forwarder\_config\_log\_source\_config module
----------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.aws_lambda_forwarder_config_log_source_config
:members:
:show-inheritance:

datadog\_api\_client.v2.model.aws\_log\_source\_tag\_filter module
------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.aws_log_source_tag_filter
:members:
:show-inheritance:

datadog\_api\_client.v2.model.aws\_logs\_config module
------------------------------------------------------

Expand Down
14 changes: 14 additions & 0 deletions examples/v2/aws-integration/CreateAWSAccount.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
from datadog_api_client.v2.model.aws_account_type import AWSAccountType
from datadog_api_client.v2.model.aws_auth_config_keys import AWSAuthConfigKeys
from datadog_api_client.v2.model.aws_lambda_forwarder_config import AWSLambdaForwarderConfig
from datadog_api_client.v2.model.aws_lambda_forwarder_config_log_source_config import (
AWSLambdaForwarderConfigLogSourceConfig,
)
from datadog_api_client.v2.model.aws_log_source_tag_filter import AWSLogSourceTagFilter
from datadog_api_client.v2.model.aws_logs_config import AWSLogsConfig
from datadog_api_client.v2.model.aws_metrics_config import AWSMetricsConfig
from datadog_api_client.v2.model.aws_namespace_tag_filter import AWSNamespaceTagFilter
Expand All @@ -34,6 +38,16 @@
lambdas=[
"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder",
],
log_source_config=AWSLambdaForwarderConfigLogSourceConfig(
tag_filters=[
AWSLogSourceTagFilter(
source="s3",
tags=[
"test:test",
],
),
],
),
sources=[
"s3",
],
Expand Down
14 changes: 14 additions & 0 deletions examples/v2/aws-integration/CreateAWSAccount_1716720881.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
from datadog_api_client.v2.model.aws_account_type import AWSAccountType
from datadog_api_client.v2.model.aws_auth_config_role import AWSAuthConfigRole
from datadog_api_client.v2.model.aws_lambda_forwarder_config import AWSLambdaForwarderConfig
from datadog_api_client.v2.model.aws_lambda_forwarder_config_log_source_config import (
AWSLambdaForwarderConfigLogSourceConfig,
)
from datadog_api_client.v2.model.aws_log_source_tag_filter import AWSLogSourceTagFilter
from datadog_api_client.v2.model.aws_logs_config import AWSLogsConfig
from datadog_api_client.v2.model.aws_metrics_config import AWSMetricsConfig
from datadog_api_client.v2.model.aws_namespace_tag_filter import AWSNamespaceTagFilter
Expand All @@ -33,6 +37,16 @@
lambdas=[
"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder",
],
log_source_config=AWSLambdaForwarderConfigLogSourceConfig(
tag_filters=[
AWSLogSourceTagFilter(
source="s3",
tags=[
"test:test",
],
),
],
),
sources=[
"s3",
],
Expand Down
14 changes: 14 additions & 0 deletions examples/v2/aws-integration/UpdateAWSAccount.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
from datadog_api_client.v2.model.aws_account_update_request_data import AWSAccountUpdateRequestData
from datadog_api_client.v2.model.aws_auth_config_role import AWSAuthConfigRole
from datadog_api_client.v2.model.aws_lambda_forwarder_config import AWSLambdaForwarderConfig
from datadog_api_client.v2.model.aws_lambda_forwarder_config_log_source_config import (
AWSLambdaForwarderConfigLogSourceConfig,
)
from datadog_api_client.v2.model.aws_log_source_tag_filter import AWSLogSourceTagFilter
from datadog_api_client.v2.model.aws_logs_config import AWSLogsConfig
from datadog_api_client.v2.model.aws_metrics_config import AWSMetricsConfig
from datadog_api_client.v2.model.aws_namespace_tag_filter import AWSNamespaceTagFilter
Expand All @@ -37,6 +41,16 @@
lambdas=[
"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder",
],
log_source_config=AWSLambdaForwarderConfigLogSourceConfig(
tag_filters=[
AWSLogSourceTagFilter(
source="s3",
tags=[
"test:test",
],
),
],
),
sources=[
"s3",
],
Expand Down
25 changes: 23 additions & 2 deletions src/datadog_api_client/v2/model/aws_lambda_forwarder_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, Union
from typing import List, Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
Expand All @@ -13,21 +13,37 @@
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.aws_lambda_forwarder_config_log_source_config import (
AWSLambdaForwarderConfigLogSourceConfig,
)


class AWSLambdaForwarderConfig(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.aws_lambda_forwarder_config_log_source_config import (
AWSLambdaForwarderConfigLogSourceConfig,
)

return {
"lambdas": ([str],),
"log_source_config": (AWSLambdaForwarderConfigLogSourceConfig,),
"sources": ([str],),
}

attribute_map = {
"lambdas": "lambdas",
"log_source_config": "log_source_config",
"sources": "sources",
}

def __init__(
self_, lambdas: Union[List[str], UnsetType] = unset, sources: Union[List[str], UnsetType] = unset, **kwargs
self_,
lambdas: Union[List[str], UnsetType] = unset,
log_source_config: Union[AWSLambdaForwarderConfigLogSourceConfig, UnsetType] = unset,
sources: Union[List[str], UnsetType] = unset,
**kwargs,
):
"""
Log Autosubscription configuration for Datadog Forwarder Lambda functions. Automatically set up triggers for existing
Expand All @@ -36,12 +52,17 @@ def __init__(
:param lambdas: List of Datadog Lambda Log Forwarder ARNs in your AWS account. Defaults to ``[]``.
:type lambdas: [str], optional

:param log_source_config: Log source configuration.
:type log_source_config: AWSLambdaForwarderConfigLogSourceConfig, optional

:param sources: 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 <https://docs.datadoghq.com/api/latest/aws-logs-integration/#get-list-of-aws-log-ready-services>`_ endpoint.
:type sources: [str], optional
"""
if lambdas is not unset:
kwargs["lambdas"] = lambdas
if log_source_config is not unset:
kwargs["log_source_config"] = log_source_config
if sources is not unset:
kwargs["sources"] = sources
super().__init__(kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.aws_log_source_tag_filter import AWSLogSourceTagFilter


class AWSLambdaForwarderConfigLogSourceConfig(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.aws_log_source_tag_filter import AWSLogSourceTagFilter

return {
"tag_filters": ([AWSLogSourceTagFilter],),
}

attribute_map = {
"tag_filters": "tag_filters",
}

def __init__(self_, tag_filters: Union[List[AWSLogSourceTagFilter], UnsetType] = unset, **kwargs):
"""
Log source configuration.

:param tag_filters: List of AWS log source tag filters. Defaults to ``[]``.
:type tag_filters: [AWSLogSourceTagFilter], optional
"""
if tag_filters is not unset:
kwargs["tag_filters"] = tag_filters
super().__init__(kwargs)
49 changes: 49 additions & 0 deletions src/datadog_api_client/v2/model/aws_log_source_tag_filter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, Union

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
none_type,
unset,
UnsetType,
)


class AWSLogSourceTagFilter(ModelNormal):
@cached_property
def openapi_types(_):
return {
"source": (str,),
"tags": ([str], none_type),
}

attribute_map = {
"source": "source",
"tags": "tags",
}

def __init__(
self_, source: Union[str, UnsetType] = unset, tags: Union[List[str], none_type, UnsetType] = unset, **kwargs
):
"""
AWS log source tag filter list. Defaults to ``[]``.
Array of log source to AWS resource tag mappings. Each mapping contains a log source and its associated AWS resource tags (in ``key:value`` format) used to filter logs submitted to Datadog.
Tag filters are applied for tags on the AWS resource emitting logs; tags associated with the log storage entity (such as a CloudWatch Log Group or S3 Bucket) are not considered.
For more information on resource tag filter syntax, `see AWS resource exclusion <https://docs.datadoghq.com/account_management/billing/aws/#aws-resource-exclusion>`_ in the AWS integration billing page.

:param source: The AWS log source to which the tag filters defined in ``tags`` are applied.
:type source: str, optional

:param tags: The AWS resource tags to filter on for the log source specified by ``source``.
:type tags: [str], none_type, optional
"""
if source is not unset:
kwargs["source"] = source
if tags is not unset:
kwargs["tags"] = tags
super().__init__(kwargs)
6 changes: 6 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
from datadog_api_client.v2.model.aws_integration_type import AWSIntegrationType
from datadog_api_client.v2.model.aws_integration_update import AWSIntegrationUpdate
from datadog_api_client.v2.model.aws_lambda_forwarder_config import AWSLambdaForwarderConfig
from datadog_api_client.v2.model.aws_lambda_forwarder_config_log_source_config import (
AWSLambdaForwarderConfigLogSourceConfig,
)
from datadog_api_client.v2.model.aws_log_source_tag_filter import AWSLogSourceTagFilter
from datadog_api_client.v2.model.aws_logs_config import AWSLogsConfig
from datadog_api_client.v2.model.aws_logs_services_response import AWSLogsServicesResponse
from datadog_api_client.v2.model.aws_logs_services_response_attributes import AWSLogsServicesResponseAttributes
Expand Down Expand Up @@ -3859,6 +3863,8 @@
"AWSIntegrationType",
"AWSIntegrationUpdate",
"AWSLambdaForwarderConfig",
"AWSLambdaForwarderConfigLogSourceConfig",
"AWSLogSourceTagFilter",
"AWSLogsConfig",
"AWSLogsServicesResponse",
"AWSLogsServicesResponseAttributes",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-11-14T20:07:56.996Z
2025-08-06T17:41:40.185Z
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
interactions:
- request:
body: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"automute_enabled":true,"collect_cloudwatch_alarms":true,"collect_custom_metrics":true,"enabled":true,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}]},"resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{}},"type":"account"}}'
body: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"log_source_config":{"tag_filters":[{"source":"s3","tags":["test:test"]}]},"sources":["s3"]}},"metrics_config":{"automute_enabled":true,"collect_cloudwatch_alarms":true,"collect_custom_metrics":true,"enabled":true,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}]},"resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{}},"type":"account"}}'
headers:
accept:
- application/json
Expand All @@ -10,7 +10,7 @@ interactions:
uri: https://api.datadoghq.com/api/v2/integration/aws/accounts
response:
body:
string: '{"data":{"id":"c2d871fe-ba0c-441d-acc8-d49d28c748f4","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"7f40a01ff2444f4f94442f52223ea7cf"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_all":true},"created_at":"2024-11-14T20:07:57.608241244Z","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"]}},"metrics_config":{"enabled":true,"automute_enabled":true,"collect_custom_metrics":true,"collect_cloudwatch_alarms":true,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}],"namespace_filters":{"exclude_only":["AWS/SQS","AWS/ElasticMapReduce"]}},"modified_at":"2024-11-14T20:07:57.60824734Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":[]}}}}}'
string: '{"data":{"id":"4ee52a3f-d0e9-487b-bde9-cd1cbc0e4cb0","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"a4e4a6b4c2cf4638a58b1febc6b856e9"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_all":true},"created_at":"2025-08-06T17:41:41.111886478Z","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"sources":["s3"],"log_source_config":{"tag_filters":[{"source":"s3","tags":["test:test"]}]}}},"metrics_config":{"enabled":true,"automute_enabled":true,"collect_custom_metrics":true,"collect_cloudwatch_alarms":true,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}],"namespace_filters":{"exclude_only":["AWS/SQS","AWS/ElasticMapReduce"]}},"modified_at":"2025-08-06T17:41:41.111886478Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":[]}}}}}'
headers:
content-type:
- application/vnd.api+json
Expand All @@ -23,7 +23,7 @@ interactions:
accept:
- '*/*'
method: DELETE
uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/c2d871fe-ba0c-441d-acc8-d49d28c748f4
uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/4ee52a3f-d0e9-487b-bde9-cd1cbc0e4cb0
response:
body:
string: ''
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-11-14T20:07:57.855Z
2025-08-06T17:41:41.364Z
Loading
Loading