diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 82b87c5b71..eea8d903b4 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1496,6 +1496,8 @@ components: $ref: '#/components/schemas/AWSAccountPartition' aws_regions: $ref: '#/components/schemas/AWSRegions' + ccm_config: + $ref: '#/components/schemas/AWSCCMConfig' logs_config: $ref: '#/components/schemas/AWSLogsConfig' metrics_config: @@ -1561,6 +1563,8 @@ components: $ref: '#/components/schemas/AWSAccountPartition' aws_regions: $ref: '#/components/schemas/AWSRegions' + ccm_config: + $ref: '#/components/schemas/AWSCCMConfig' created_at: description: Timestamp of when the account integration was created. format: date-time @@ -1634,6 +1638,8 @@ components: $ref: '#/components/schemas/AWSAccountPartition' aws_regions: $ref: '#/components/schemas/AWSRegions' + ccm_config: + $ref: '#/components/schemas/AWSCCMConfig' logs_config: $ref: '#/components/schemas/AWSLogsConfig' metrics_config: @@ -1765,6 +1771,15 @@ components: required: - role_name type: object + AWSCCMConfig: + description: AWS Cloud Cost Management config. + properties: + data_export_configs: + description: List of data export configurations for Cost and Usage Reports. + items: + $ref: '#/components/schemas/DataExportConfig' + type: array + type: object AWSCredentials: description: The definition of `AWSCredentials` object. oneOf: @@ -16354,6 +16369,30 @@ components: example: canceled type: string type: object + DataExportConfig: + description: AWS Cost and Usage Report data export configuration. + properties: + bucket_name: + description: Name of the S3 bucket where the Cost and Usage Report is stored. + example: billing + type: string + bucket_region: + description: AWS region of the S3 bucket. + example: us-east-1 + type: string + report_name: + description: Name of the Cost and Usage Report. + example: cost-and-usage-report + type: string + report_prefix: + description: S3 prefix where the Cost and Usage Report is stored. + example: reports + type: string + report_type: + description: Type of the Cost and Usage Report. + example: CUR2.0 + type: string + type: object DataRelationshipsTeams: description: Associates teams with this schedule in a data structure. properties: diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 19370f1cf4..f4e5a82376 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -2279,6 +2279,13 @@ datadog\_api\_client.v2.model.aws\_traces\_config module :members: :show-inheritance: +datadog\_api\_client.v2.model.awsccm\_config module +--------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.awsccm_config + :members: + :show-inheritance: + datadog\_api\_client.v2.model.azure\_credentials module ------------------------------------------------------- @@ -6451,6 +6458,13 @@ datadog\_api\_client.v2.model.data\_deletion\_response\_meta module :members: :show-inheritance: +datadog\_api\_client.v2.model.data\_export\_config module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.data_export_config + :members: + :show-inheritance: + datadog\_api\_client.v2.model.data\_relationships\_teams module --------------------------------------------------------------- diff --git a/examples/v2/aws-integration/CreateAWSAccount.py b/examples/v2/aws-integration/CreateAWSAccount.py index d9f1dc3093..9d6c71014c 100644 --- a/examples/v2/aws-integration/CreateAWSAccount.py +++ b/examples/v2/aws-integration/CreateAWSAccount.py @@ -20,6 +20,8 @@ from datadog_api_client.v2.model.aws_namespace_tag_filter import AWSNamespaceTagFilter from datadog_api_client.v2.model.aws_resources_config import AWSResourcesConfig from datadog_api_client.v2.model.aws_traces_config import AWSTracesConfig +from datadog_api_client.v2.model.awsccm_config import AWSCCMConfig +from datadog_api_client.v2.model.data_export_config import DataExportConfig body = AWSAccountCreateRequest( data=AWSAccountCreateRequestData( @@ -33,6 +35,17 @@ ), aws_account_id="123456789012", aws_partition=AWSAccountPartition.AWS, + ccm_config=AWSCCMConfig( + data_export_configs=[ + DataExportConfig( + bucket_name="my-bucket", + bucket_region="us-east-1", + report_name="my-report", + report_prefix="reports", + report_type="CUR2.0", + ), + ], + ), logs_config=AWSLogsConfig( lambda_forwarder=AWSLambdaForwarderConfig( lambdas=[ diff --git a/examples/v2/aws-integration/CreateAWSAccount_1716720881.py b/examples/v2/aws-integration/CreateAWSAccount_1716720881.py index a69f8da768..ccb5b2072c 100644 --- a/examples/v2/aws-integration/CreateAWSAccount_1716720881.py +++ b/examples/v2/aws-integration/CreateAWSAccount_1716720881.py @@ -20,6 +20,8 @@ from datadog_api_client.v2.model.aws_namespace_tag_filter import AWSNamespaceTagFilter from datadog_api_client.v2.model.aws_resources_config import AWSResourcesConfig from datadog_api_client.v2.model.aws_traces_config import AWSTracesConfig +from datadog_api_client.v2.model.awsccm_config import AWSCCMConfig +from datadog_api_client.v2.model.data_export_config import DataExportConfig body = AWSAccountCreateRequest( data=AWSAccountCreateRequestData( @@ -32,6 +34,17 @@ ), aws_account_id="123456789012", aws_partition=AWSAccountPartition.AWS, + ccm_config=AWSCCMConfig( + data_export_configs=[ + DataExportConfig( + bucket_name="my-bucket", + bucket_region="us-east-1", + report_name="my-report", + report_prefix="reports", + report_type="CUR2.0", + ), + ], + ), logs_config=AWSLogsConfig( lambda_forwarder=AWSLambdaForwarderConfig( lambdas=[ diff --git a/examples/v2/aws-integration/UpdateAWSAccount.py b/examples/v2/aws-integration/UpdateAWSAccount.py index 9491c725a1..5d6c69fedc 100644 --- a/examples/v2/aws-integration/UpdateAWSAccount.py +++ b/examples/v2/aws-integration/UpdateAWSAccount.py @@ -21,6 +21,8 @@ from datadog_api_client.v2.model.aws_namespace_tag_filter import AWSNamespaceTagFilter from datadog_api_client.v2.model.aws_resources_config import AWSResourcesConfig from datadog_api_client.v2.model.aws_traces_config import AWSTracesConfig +from datadog_api_client.v2.model.awsccm_config import AWSCCMConfig +from datadog_api_client.v2.model.data_export_config import DataExportConfig # there is a valid "aws_account_v2" in the system AWS_ACCOUNT_V2_DATA_ID = environ["AWS_ACCOUNT_V2_DATA_ID"] @@ -36,6 +38,17 @@ ), aws_account_id="123456789012", aws_partition=AWSAccountPartition.AWS, + ccm_config=AWSCCMConfig( + data_export_configs=[ + DataExportConfig( + bucket_name="updated-bucket", + bucket_region="us-west-2", + report_name="updated-report", + report_prefix="cost-reports", + report_type="CUR2.0", + ), + ], + ), logs_config=AWSLogsConfig( lambda_forwarder=AWSLambdaForwarderConfig( lambdas=[ diff --git a/src/datadog_api_client/v2/model/aws_account_create_request_attributes.py b/src/datadog_api_client/v2/model/aws_account_create_request_attributes.py index 9f781edf15..bada518e2a 100644 --- a/src/datadog_api_client/v2/model/aws_account_create_request_attributes.py +++ b/src/datadog_api_client/v2/model/aws_account_create_request_attributes.py @@ -18,6 +18,7 @@ from datadog_api_client.v2.model.aws_auth_config import AWSAuthConfig from datadog_api_client.v2.model.aws_account_partition import AWSAccountPartition from datadog_api_client.v2.model.aws_regions import AWSRegions + from datadog_api_client.v2.model.awsccm_config import AWSCCMConfig 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_resources_config import AWSResourcesConfig @@ -34,6 +35,7 @@ def openapi_types(_): from datadog_api_client.v2.model.aws_auth_config import AWSAuthConfig from datadog_api_client.v2.model.aws_account_partition import AWSAccountPartition from datadog_api_client.v2.model.aws_regions import AWSRegions + from datadog_api_client.v2.model.awsccm_config import AWSCCMConfig 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_resources_config import AWSResourcesConfig @@ -45,6 +47,7 @@ def openapi_types(_): "aws_account_id": (str,), "aws_partition": (AWSAccountPartition,), "aws_regions": (AWSRegions,), + "ccm_config": (AWSCCMConfig,), "logs_config": (AWSLogsConfig,), "metrics_config": (AWSMetricsConfig,), "resources_config": (AWSResourcesConfig,), @@ -57,6 +60,7 @@ def openapi_types(_): "aws_account_id": "aws_account_id", "aws_partition": "aws_partition", "aws_regions": "aws_regions", + "ccm_config": "ccm_config", "logs_config": "logs_config", "metrics_config": "metrics_config", "resources_config": "resources_config", @@ -70,6 +74,7 @@ def __init__( aws_partition: AWSAccountPartition, account_tags: Union[List[str], none_type, UnsetType] = unset, aws_regions: Union[AWSRegions, AWSRegionsIncludeAll, AWSRegionsIncludeOnly, UnsetType] = unset, + ccm_config: Union[AWSCCMConfig, UnsetType] = unset, logs_config: Union[AWSLogsConfig, UnsetType] = unset, metrics_config: Union[AWSMetricsConfig, UnsetType] = unset, resources_config: Union[AWSResourcesConfig, UnsetType] = unset, @@ -96,6 +101,9 @@ def __init__( :param aws_regions: AWS Regions to collect data from. Defaults to ``include_all``. :type aws_regions: AWSRegions, optional + :param ccm_config: AWS Cloud Cost Management config. + :type ccm_config: AWSCCMConfig, optional + :param logs_config: AWS Logs Collection config. :type logs_config: AWSLogsConfig, optional @@ -112,6 +120,8 @@ def __init__( kwargs["account_tags"] = account_tags if aws_regions is not unset: kwargs["aws_regions"] = aws_regions + if ccm_config is not unset: + kwargs["ccm_config"] = ccm_config if logs_config is not unset: kwargs["logs_config"] = logs_config if metrics_config is not unset: diff --git a/src/datadog_api_client/v2/model/aws_account_response_attributes.py b/src/datadog_api_client/v2/model/aws_account_response_attributes.py index 5f2bd6db6e..d74219e895 100644 --- a/src/datadog_api_client/v2/model/aws_account_response_attributes.py +++ b/src/datadog_api_client/v2/model/aws_account_response_attributes.py @@ -19,6 +19,7 @@ from datadog_api_client.v2.model.aws_auth_config import AWSAuthConfig from datadog_api_client.v2.model.aws_account_partition import AWSAccountPartition from datadog_api_client.v2.model.aws_regions import AWSRegions + from datadog_api_client.v2.model.awsccm_config import AWSCCMConfig 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_resources_config import AWSResourcesConfig @@ -35,6 +36,7 @@ def openapi_types(_): from datadog_api_client.v2.model.aws_auth_config import AWSAuthConfig from datadog_api_client.v2.model.aws_account_partition import AWSAccountPartition from datadog_api_client.v2.model.aws_regions import AWSRegions + from datadog_api_client.v2.model.awsccm_config import AWSCCMConfig 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_resources_config import AWSResourcesConfig @@ -46,6 +48,7 @@ def openapi_types(_): "aws_account_id": (str,), "aws_partition": (AWSAccountPartition,), "aws_regions": (AWSRegions,), + "ccm_config": (AWSCCMConfig,), "created_at": (datetime,), "logs_config": (AWSLogsConfig,), "metrics_config": (AWSMetricsConfig,), @@ -60,6 +63,7 @@ def openapi_types(_): "aws_account_id": "aws_account_id", "aws_partition": "aws_partition", "aws_regions": "aws_regions", + "ccm_config": "ccm_config", "created_at": "created_at", "logs_config": "logs_config", "metrics_config": "metrics_config", @@ -79,6 +83,7 @@ def __init__( auth_config: Union[AWSAuthConfig, AWSAuthConfigKeys, AWSAuthConfigRole, UnsetType] = unset, aws_partition: Union[AWSAccountPartition, UnsetType] = unset, aws_regions: Union[AWSRegions, AWSRegionsIncludeAll, AWSRegionsIncludeOnly, UnsetType] = unset, + ccm_config: Union[AWSCCMConfig, UnsetType] = unset, created_at: Union[datetime, UnsetType] = unset, logs_config: Union[AWSLogsConfig, UnsetType] = unset, metrics_config: Union[AWSMetricsConfig, UnsetType] = unset, @@ -107,6 +112,9 @@ def __init__( :param aws_regions: AWS Regions to collect data from. Defaults to ``include_all``. :type aws_regions: AWSRegions, optional + :param ccm_config: AWS Cloud Cost Management config. + :type ccm_config: AWSCCMConfig, optional + :param created_at: Timestamp of when the account integration was created. :type created_at: datetime, optional @@ -133,6 +141,8 @@ def __init__( kwargs["aws_partition"] = aws_partition if aws_regions is not unset: kwargs["aws_regions"] = aws_regions + if ccm_config is not unset: + kwargs["ccm_config"] = ccm_config if created_at is not unset: kwargs["created_at"] = created_at if logs_config is not unset: diff --git a/src/datadog_api_client/v2/model/aws_account_update_request_attributes.py b/src/datadog_api_client/v2/model/aws_account_update_request_attributes.py index af71621a06..efb4dfabb9 100644 --- a/src/datadog_api_client/v2/model/aws_account_update_request_attributes.py +++ b/src/datadog_api_client/v2/model/aws_account_update_request_attributes.py @@ -18,6 +18,7 @@ from datadog_api_client.v2.model.aws_auth_config import AWSAuthConfig from datadog_api_client.v2.model.aws_account_partition import AWSAccountPartition from datadog_api_client.v2.model.aws_regions import AWSRegions + from datadog_api_client.v2.model.awsccm_config import AWSCCMConfig 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_resources_config import AWSResourcesConfig @@ -34,6 +35,7 @@ def openapi_types(_): from datadog_api_client.v2.model.aws_auth_config import AWSAuthConfig from datadog_api_client.v2.model.aws_account_partition import AWSAccountPartition from datadog_api_client.v2.model.aws_regions import AWSRegions + from datadog_api_client.v2.model.awsccm_config import AWSCCMConfig 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_resources_config import AWSResourcesConfig @@ -45,6 +47,7 @@ def openapi_types(_): "aws_account_id": (str,), "aws_partition": (AWSAccountPartition,), "aws_regions": (AWSRegions,), + "ccm_config": (AWSCCMConfig,), "logs_config": (AWSLogsConfig,), "metrics_config": (AWSMetricsConfig,), "resources_config": (AWSResourcesConfig,), @@ -57,6 +60,7 @@ def openapi_types(_): "aws_account_id": "aws_account_id", "aws_partition": "aws_partition", "aws_regions": "aws_regions", + "ccm_config": "ccm_config", "logs_config": "logs_config", "metrics_config": "metrics_config", "resources_config": "resources_config", @@ -70,6 +74,7 @@ def __init__( auth_config: Union[AWSAuthConfig, AWSAuthConfigKeys, AWSAuthConfigRole, UnsetType] = unset, aws_partition: Union[AWSAccountPartition, UnsetType] = unset, aws_regions: Union[AWSRegions, AWSRegionsIncludeAll, AWSRegionsIncludeOnly, UnsetType] = unset, + ccm_config: Union[AWSCCMConfig, UnsetType] = unset, logs_config: Union[AWSLogsConfig, UnsetType] = unset, metrics_config: Union[AWSMetricsConfig, UnsetType] = unset, resources_config: Union[AWSResourcesConfig, UnsetType] = unset, @@ -96,6 +101,9 @@ def __init__( :param aws_regions: AWS Regions to collect data from. Defaults to ``include_all``. :type aws_regions: AWSRegions, optional + :param ccm_config: AWS Cloud Cost Management config. + :type ccm_config: AWSCCMConfig, optional + :param logs_config: AWS Logs Collection config. :type logs_config: AWSLogsConfig, optional @@ -116,6 +124,8 @@ def __init__( kwargs["aws_partition"] = aws_partition if aws_regions is not unset: kwargs["aws_regions"] = aws_regions + if ccm_config is not unset: + kwargs["ccm_config"] = ccm_config if logs_config is not unset: kwargs["logs_config"] = logs_config if metrics_config is not unset: diff --git a/src/datadog_api_client/v2/model/awsccm_config.py b/src/datadog_api_client/v2/model/awsccm_config.py new file mode 100644 index 0000000000..d0482b020e --- /dev/null +++ b/src/datadog_api_client/v2/model/awsccm_config.py @@ -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.data_export_config import DataExportConfig + + +class AWSCCMConfig(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.data_export_config import DataExportConfig + + return { + "data_export_configs": ([DataExportConfig],), + } + + attribute_map = { + "data_export_configs": "data_export_configs", + } + + def __init__(self_, data_export_configs: Union[List[DataExportConfig], UnsetType] = unset, **kwargs): + """ + AWS Cloud Cost Management config. + + :param data_export_configs: List of data export configurations for Cost and Usage Reports. + :type data_export_configs: [DataExportConfig], optional + """ + if data_export_configs is not unset: + kwargs["data_export_configs"] = data_export_configs + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/data_export_config.py b/src/datadog_api_client/v2/model/data_export_config.py new file mode 100644 index 0000000000..d2ac655643 --- /dev/null +++ b/src/datadog_api_client/v2/model/data_export_config.py @@ -0,0 +1,72 @@ +# 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 Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class DataExportConfig(ModelNormal): + @cached_property + def openapi_types(_): + return { + "bucket_name": (str,), + "bucket_region": (str,), + "report_name": (str,), + "report_prefix": (str,), + "report_type": (str,), + } + + attribute_map = { + "bucket_name": "bucket_name", + "bucket_region": "bucket_region", + "report_name": "report_name", + "report_prefix": "report_prefix", + "report_type": "report_type", + } + + def __init__( + self_, + bucket_name: Union[str, UnsetType] = unset, + bucket_region: Union[str, UnsetType] = unset, + report_name: Union[str, UnsetType] = unset, + report_prefix: Union[str, UnsetType] = unset, + report_type: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + AWS Cost and Usage Report data export configuration. + + :param bucket_name: Name of the S3 bucket where the Cost and Usage Report is stored. + :type bucket_name: str, optional + + :param bucket_region: AWS region of the S3 bucket. + :type bucket_region: str, optional + + :param report_name: Name of the Cost and Usage Report. + :type report_name: str, optional + + :param report_prefix: S3 prefix where the Cost and Usage Report is stored. + :type report_prefix: str, optional + + :param report_type: Type of the Cost and Usage Report. + :type report_type: str, optional + """ + if bucket_name is not unset: + kwargs["bucket_name"] = bucket_name + if bucket_region is not unset: + kwargs["bucket_region"] = bucket_region + if report_name is not unset: + kwargs["report_name"] = report_name + if report_prefix is not unset: + kwargs["report_prefix"] = report_prefix + if report_type is not unset: + kwargs["report_type"] = report_type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 801962e810..12010e1bd8 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -33,6 +33,7 @@ from datadog_api_client.v2.model.aws_auth_config import AWSAuthConfig from datadog_api_client.v2.model.aws_auth_config_keys import AWSAuthConfigKeys from datadog_api_client.v2.model.aws_auth_config_role import AWSAuthConfigRole +from datadog_api_client.v2.model.awsccm_config import AWSCCMConfig from datadog_api_client.v2.model.aws_credentials import AWSCredentials from datadog_api_client.v2.model.aws_credentials_update import AWSCredentialsUpdate from datadog_api_client.v2.model.aws_event_bridge_account_configuration import AWSEventBridgeAccountConfiguration @@ -1318,6 +1319,7 @@ from datadog_api_client.v2.model.data_deletion_response_item import DataDeletionResponseItem from datadog_api_client.v2.model.data_deletion_response_item_attributes import DataDeletionResponseItemAttributes from datadog_api_client.v2.model.data_deletion_response_meta import DataDeletionResponseMeta +from datadog_api_client.v2.model.data_export_config import DataExportConfig from datadog_api_client.v2.model.data_relationships_teams import DataRelationshipsTeams from datadog_api_client.v2.model.data_relationships_teams_data_items import DataRelationshipsTeamsDataItems from datadog_api_client.v2.model.data_relationships_teams_data_items_type import DataRelationshipsTeamsDataItemsType @@ -5110,6 +5112,7 @@ "AWSAuthConfig", "AWSAuthConfigKeys", "AWSAuthConfigRole", + "AWSCCMConfig", "AWSCredentials", "AWSCredentialsUpdate", "AWSEventBridgeAccountConfiguration", @@ -6023,6 +6026,7 @@ "DataDeletionResponseItem", "DataDeletionResponseItemAttributes", "DataDeletionResponseMeta", + "DataExportConfig", "DataRelationshipsTeams", "DataRelationshipsTeamsDataItems", "DataRelationshipsTeamsDataItemsType", diff --git a/tests/v2/cassettes/test_scenarios/test_create_an_aws_account_returns_aws_account_object_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_an_aws_account_returns_aws_account_object_response.frozen index b63a9ddbfc..403f0e6375 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_an_aws_account_returns_aws_account_object_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_create_an_aws_account_returns_aws_account_object_response.frozen @@ -1 +1 @@ -2025-08-06T17:41:40.185Z \ No newline at end of file +2025-12-10T17:32:09.613Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_an_aws_account_returns_aws_account_object_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_an_aws_account_returns_aws_account_object_response.yaml index 7d7ea234cc..44070f9ba1 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_an_aws_account_returns_aws_account_object_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_create_an_aws_account_returns_aws_account_object_response.yaml @@ -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"],"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"}}' + body: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","ccm_config":{"data_export_configs":[{"bucket_name":"my-bucket","bucket_region":"us-east-1","report_name":"my-report","report_prefix":"reports","report_type":"CUR2.0"}]},"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 @@ -10,7 +10,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/integration/aws/accounts response: body: - 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":[]}}}}}' + string: '{"data":{"id":"de1a3b78-ed2e-4f50-9191-1879129d09ff","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"55d4a43935224fe09c096f96392f1ca1"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_all":true},"ccm_config":{"data_export_configs":[{"report_name":"my-report","report_prefix":"reports","report_type":"CUR2.0","bucket_name":"my-bucket","bucket_region":"us-east-1"}]},"created_at":"2025-12-10T17:32:11.003276673Z","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","AWS/Usage"]}},"modified_at":"2025-12-10T17:32:11.003276673Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":[]}}}}}' headers: content-type: - application/vnd.api+json @@ -23,7 +23,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/4ee52a3f-d0e9-487b-bde9-cd1cbc0e4cb0 + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/de1a3b78-ed2e-4f50-9191-1879129d09ff response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_aws_account_object_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_aws_account_object_response.frozen index d0e249e860..dfc78df9ae 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_aws_account_object_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_aws_account_object_response.frozen @@ -1 +1 @@ -2025-08-06T17:41:41.364Z \ No newline at end of file +2025-12-10T17:32:36.829Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_aws_account_object_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_aws_account_object_response.yaml index fa6850966b..939e7a5f10 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_aws_account_object_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_aws_account_object_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"access_key_id":"AKIAIOSFODNN7EXAMPLE","secret_access_key":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"},"aws_account_id":"123456789012","aws_partition":"aws","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"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"}}' + body: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"access_key_id":"AKIAIOSFODNN7EXAMPLE","secret_access_key":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"},"aws_account_id":"123456789012","aws_partition":"aws","ccm_config":{"data_export_configs":[{"bucket_name":"my-bucket","bucket_region":"us-east-1","report_name":"my-report","report_prefix":"reports","report_type":"CUR2.0"}]},"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 @@ -10,7 +10,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/integration/aws/accounts response: body: - string: '{"data":{"id":"c80e30d5-b3f9-45b1-85fc-bad652af206b","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"access_key_id":"AKIAIOSFODNN7EXAMPLE"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_all":true},"created_at":"2025-08-06T17:41:41.445076718Z","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.445076718Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":[]}}}}}' + string: '{"data":{"id":"a7d72fb6-ec59-4eca-a905-805dd599d061","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"access_key_id":"AKIAIOSFODNN7EXAMPLE"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_all":true},"ccm_config":{"data_export_configs":[{"report_name":"my-report","report_prefix":"reports","report_type":"CUR2.0","bucket_name":"my-bucket","bucket_region":"us-east-1"}]},"created_at":"2025-12-10T17:32:37.014514664Z","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","AWS/Usage"]}},"modified_at":"2025-12-10T17:32:37.014514664Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":[]}}}}}' headers: content-type: - application/vnd.api+json @@ -23,7 +23,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/c80e30d5-b3f9-45b1-85fc-bad652af206b + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/a7d72fb6-ec59-4eca-a905-805dd599d061 response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_bad_request_response.frozen index abfd935a03..2800bbe0aa 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_bad_request_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_bad_request_response.frozen @@ -1 +1 @@ -2025-08-06T17:41:41.716Z \ No newline at end of file +2025-12-10T17:34:11.261Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_bad_request_response.yaml index bff8f111f7..80cc80970f 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_bad_request_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_create_an_aws_integration_returns_bad_request_response.yaml @@ -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-invalid","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"}}' + body: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws-invalid","ccm_config":{"data_export_configs":[{"bucket_name":"my-bucket","bucket_region":"us-east-1","report_name":"my-report","report_prefix":"reports","report_type":"CUR2.0"}]},"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 diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_aws_account_object_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_aws_account_object_response.frozen index 770d0364bd..0acb432176 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_aws_account_object_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_aws_account_object_response.frozen @@ -1 +1 @@ -2025-08-06T17:41:51.622Z \ No newline at end of file +2025-12-10T17:40:36.176Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_aws_account_object_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_aws_account_object_response.yaml index 9183f3345d..8dc1203cbc 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_aws_account_object_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_aws_account_object_response.yaml @@ -10,7 +10,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/integration/aws/accounts response: body: - string: '{"data":{"id":"ab6528e3-5dab-4375-ae47-4ce93d1216e2","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"36416390710445e7be511e1622ee4149"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2025-08-06T17:41:52.510132689Z","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":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}],"namespace_filters":{"include_only":["AWS/EC2"]}},"modified_at":"2025-08-06T17:41:52.510132689Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}}}' + string: '{"data":{"id":"0c2238ef-3b8e-4d25-85df-b18f96ac7031","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"a297178885da4934acf9eca79f3e7892"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2025-12-10T17:40:37.609564422Z","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":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}],"namespace_filters":{"include_only":["AWS/EC2"]}},"modified_at":"2025-12-10T17:40:37.609564422Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}}}' headers: content-type: - application/vnd.api+json @@ -18,17 +18,17 @@ interactions: code: 200 message: OK - 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"],"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"}}' + body: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","ccm_config":{"data_export_configs":[{"bucket_name":"updated-bucket","bucket_region":"us-west-2","report_name":"updated-report","report_prefix":"cost-reports","report_type":"CUR2.0"}]},"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 content-type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/ab6528e3-5dab-4375-ae47-4ce93d1216e2 + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/0c2238ef-3b8e-4d25-85df-b18f96ac7031 response: body: - string: '{"data":{"id":"ab6528e3-5dab-4375-ae47-4ce93d1216e2","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"36416390710445e7be511e1622ee4149"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2025-08-06T17:41:52.510132Z","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":{"include_only":["AWS/EC2"]}},"modified_at":"2025-08-06T17:41:52.717094345Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}}}' + string: '{"data":{"id":"0c2238ef-3b8e-4d25-85df-b18f96ac7031","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"a297178885da4934acf9eca79f3e7892"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"ccm_config":{"data_export_configs":[{"report_name":"updated-report","report_prefix":"cost-reports","report_type":"CUR2.0","bucket_name":"updated-bucket","bucket_region":"us-west-2"}]},"created_at":"2025-12-10T17:40:37.609564Z","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":{"include_only":["AWS/EC2"]}},"modified_at":"2025-12-10T17:40:37.867410688Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}}}' headers: content-type: - application/vnd.api+json @@ -41,7 +41,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/ab6528e3-5dab-4375-ae47-4ce93d1216e2 + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/0c2238ef-3b8e-4d25-85df-b18f96ac7031 response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_bad_request_response.frozen index 2ad05fcd48..e550a60221 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_bad_request_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_bad_request_response.frozen @@ -1 +1 @@ -2025-08-06T17:41:53.059Z \ No newline at end of file +2025-12-10T17:42:50.556Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_bad_request_response.yaml index b6b63f2b42..4052424b85 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_bad_request_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_bad_request_response.yaml @@ -10,7 +10,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/integration/aws/accounts response: body: - string: '{"data":{"id":"dff6d3ee-e90a-4df1-b0d7-6f4e1ed35acc","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"f3f5392d608c448ca4910d7adcefa849"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2025-08-06T17:41:54.148895503Z","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":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}],"namespace_filters":{"include_only":["AWS/EC2"]}},"modified_at":"2025-08-06T17:41:54.148895503Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}}}' + string: '{"data":{"id":"0c358c9f-84fd-4fe5-b0e9-722d787de213","type":"account","attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole","external_id":"84a9c55851ce4a01869c503e990d325b"},"aws_account_id":"123456789012","aws_partition":"aws","aws_regions":{"include_only":["us-east-1"]},"created_at":"2025-12-10T17:42:52.162655791Z","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":false,"collect_cloudwatch_alarms":false,"tag_filters":[{"namespace":"AWS/EC2","tags":["key:value"]}],"namespace_filters":{"include_only":["AWS/EC2"]}},"modified_at":"2025-12-10T17:42:52.162655791Z","resources_config":{"cloud_security_posture_management_collection":false,"extended_collection":false},"traces_config":{"xray_services":{"include_only":["AWS/AppSync"]}}}}}' headers: content-type: - application/vnd.api+json @@ -18,18 +18,19 @@ interactions: code: 200 message: OK - request: - body: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"access_key_id":"AKIAIOSFODNN7EXAMPLE","secret_access_key":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"},"aws_account_id":"123456789012","aws_partition":"aws","logs_config":{"lambda_forwarder":{"lambdas":["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"],"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"}}' + body: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"access_key_id":"AKIAIOSFODNN7EXAMPLE","secret_access_key":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"},"aws_account_id":"123456789012","aws_partition":"aws","ccm_config":{"data_export_configs":[{"bucket_name":"invalid-bucket","bucket_region":"invalid-region","report_name":"invalid-report","report_prefix":"invalid","report_type":"CUR2.0"}]},"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 content-type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/dff6d3ee-e90a-4df1-b0d7-6f4e1ed35acc + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/0c358c9f-84fd-4fe5-b0e9-722d787de213 response: body: - string: '{"errors":[{"title":"Generic Error","detail":"cannot switch between - role and key based auth"}]}' + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"invalid + value","meta":{"ccm_config.data_export_configs[CUR2.0].bucket_region":"invalid + bucket region: invalid-region"}}]}' headers: content-type: - application/vnd.api+json @@ -42,7 +43,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/dff6d3ee-e90a-4df1-b0d7-6f4e1ed35acc + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/0c358c9f-84fd-4fe5-b0e9-722d787de213 response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_not_found_response.frozen index 8c2f55ecb1..07ac47cd4e 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_not_found_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_not_found_response.frozen @@ -1 +1 @@ -2025-08-06T17:41:54.735Z \ No newline at end of file +2025-12-10T17:43:13.852Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_not_found_response.yaml index 289b945336..f138d52414 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_not_found_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_update_an_aws_integration_returns_not_found_response.yaml @@ -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"],"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"}}' + body: '{"data":{"attributes":{"account_tags":["key:value"],"auth_config":{"role_name":"DatadogIntegrationRole"},"aws_account_id":"123456789012","aws_partition":"aws","ccm_config":{"data_export_configs":[{"bucket_name":"notfound-bucket","bucket_region":"eu-west-1","report_name":"notfound-report","report_prefix":"notfound","report_type":"CUR2.0"}]},"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 diff --git a/tests/v2/features/aws_integration.feature b/tests/v2/features/aws_integration.feature index 30ded64d73..9e14d0824b 100644 --- a/tests/v2/features/aws_integration.feature +++ b/tests/v2/features/aws_integration.feature @@ -12,21 +12,21 @@ Feature: AWS Integration @team:DataDog/aws-integrations Scenario: Create an AWS account returns "AWS Account object" response Given new "CreateAWSAccount" request - And body with value {"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"}} + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "ccm_config": {"data_export_configs": [{"bucket_name": "my-bucket", "bucket_region": "us-east-1", "report_name": "my-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}, "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"}} When the request is sent Then the response status is 200 AWS Account object @team:DataDog/aws-integrations Scenario: Create an AWS integration returns "AWS Account object" response Given new "CreateAWSAccount" request - And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"access_key_id": "AKIAIOSFODNN7EXAMPLE", "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "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"}} + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"access_key_id": "AKIAIOSFODNN7EXAMPLE", "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}, "aws_account_id": "123456789012", "aws_partition": "aws", "ccm_config": {"data_export_configs": [{"bucket_name": "my-bucket", "bucket_region": "us-east-1", "report_name": "my-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}, "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"}} When the request is sent Then the response status is 200 AWS Account object @team:DataDog/aws-integrations Scenario: Create an AWS integration returns "Bad Request" response Given new "CreateAWSAccount" request - And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws-invalid", "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"}} + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws-invalid", "ccm_config": {"data_export_configs": [{"bucket_name": "my-bucket", "bucket_region": "us-east-1", "report_name": "my-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}, "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"}} When the request is sent Then the response status is 400 Bad Request @@ -195,7 +195,7 @@ Feature: AWS Integration Given there is a valid "aws_account_v2" in the system And new "UpdateAWSAccount" request And request contains "aws_account_config_id" parameter from "aws_account_v2.data.id" - And body with value {"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"}} + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "ccm_config": {"data_export_configs": [{"bucket_name": "updated-bucket", "bucket_region": "us-west-2", "report_name": "updated-report", "report_prefix": "cost-reports", "report_type": "CUR2.0"}]}, "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"}} When the request is sent Then the response status is 200 AWS Account object @@ -204,7 +204,7 @@ Feature: AWS Integration Given there is a valid "aws_account_v2" in the system And new "UpdateAWSAccount" request And request contains "aws_account_config_id" parameter from "aws_account_v2.data.id" - And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"access_key_id": "AKIAIOSFODNN7EXAMPLE", "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "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"}} + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"access_key_id": "AKIAIOSFODNN7EXAMPLE", "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}, "aws_account_id": "123456789012", "aws_partition": "aws", "ccm_config": {"data_export_configs": [{"bucket_name": "invalid-bucket", "bucket_region": "invalid-region", "report_name": "invalid-report", "report_prefix": "invalid", "report_type": "CUR2.0"}]}, "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"}} When the request is sent Then the response status is 400 Bad Request @@ -212,6 +212,6 @@ Feature: AWS Integration Scenario: Update an AWS integration returns "Not Found" response Given new "UpdateAWSAccount" request And request contains "aws_account_config_id" parameter with value "448169a8-251c-4344-abee-1c4edef39f7a" - And body with value {"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"}} + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "ccm_config": {"data_export_configs": [{"bucket_name": "notfound-bucket", "bucket_region": "eu-west-1", "report_name": "notfound-report", "report_prefix": "notfound", "report_type": "CUR2.0"}]}, "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"}} When the request is sent Then the response status is 404 Not Found