diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 82b87c5b71c..eea8d903b4d 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/cassettes/features/v2/aws_integration/Create-an-AWS-account-returns-AWS-Account-object-response.frozen b/cassettes/features/v2/aws_integration/Create-an-AWS-account-returns-AWS-Account-object-response.frozen index b63a9ddbfcf..403f0e6375d 100644 --- a/cassettes/features/v2/aws_integration/Create-an-AWS-account-returns-AWS-Account-object-response.frozen +++ b/cassettes/features/v2/aws_integration/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/cassettes/features/v2/aws_integration/Create-an-AWS-account-returns-AWS-Account-object-response.yml b/cassettes/features/v2/aws_integration/Create-an-AWS-account-returns-AWS-Account-object-response.yml index 7c4e90039aa..3ff2f726243 100644 --- a/cassettes/features/v2/aws_integration/Create-an-AWS-account-returns-AWS-Account-object-response.yml +++ b/cassettes/features/v2/aws_integration/Create-an-AWS-account-returns-AWS-Account-object-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Wed, 06 Aug 2025 17:41:40 GMT +- recorded_at: Wed, 10 Dec 2025 17:32:09 GMT request: body: encoding: UTF-8 - string: '{"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"}}' + string: '{"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 @@ -14,21 +14,21 @@ http_interactions: response: body: encoding: UTF-8 - 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 status: code: 200 message: OK -- recorded_at: Wed, 06 Aug 2025 17:41:40 GMT +- recorded_at: Wed, 10 Dec 2025 17:32:09 GMT request: body: null headers: 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: encoding: UTF-8 diff --git a/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-AWS-Account-object-response.frozen b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-AWS-Account-object-response.frozen index d0e249e860e..dfc78df9ae0 100644 --- a/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-AWS-Account-object-response.frozen +++ b/cassettes/features/v2/aws_integration/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/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-AWS-Account-object-response.yml b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-AWS-Account-object-response.yml index f4b4a28d864..50a2c1480c5 100644 --- a/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-AWS-Account-object-response.yml +++ b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-AWS-Account-object-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Wed, 06 Aug 2025 17:41:41 GMT +- recorded_at: Wed, 10 Dec 2025 17:32:36 GMT request: body: encoding: UTF-8 - string: '{"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"}}' + string: '{"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 @@ -14,21 +14,21 @@ http_interactions: response: body: encoding: UTF-8 - 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 status: code: 200 message: OK -- recorded_at: Wed, 06 Aug 2025 17:41:41 GMT +- recorded_at: Wed, 10 Dec 2025 17:32:36 GMT request: body: null headers: 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: encoding: UTF-8 diff --git a/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Bad-Request-response.frozen b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Bad-Request-response.frozen index abfd935a03f..2800bbe0aa2 100644 --- a/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Bad-Request-response.frozen +++ b/cassettes/features/v2/aws_integration/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/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Bad-Request-response.yml b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Bad-Request-response.yml index 79e4b109dda..eddba207c7c 100644 --- a/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Bad-Request-response.yml +++ b/cassettes/features/v2/aws_integration/Create-an-AWS-integration-returns-Bad-Request-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Wed, 06 Aug 2025 17:41:41 GMT +- recorded_at: Wed, 10 Dec 2025 17:34:11 GMT request: body: encoding: UTF-8 - string: '{"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"}}' + string: '{"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/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-AWS-Account-object-response.frozen b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-AWS-Account-object-response.frozen index 770d0364bdc..0acb432176a 100644 --- a/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-AWS-Account-object-response.frozen +++ b/cassettes/features/v2/aws_integration/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/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-AWS-Account-object-response.yml b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-AWS-Account-object-response.yml index 1b520902394..2067e6a92d3 100644 --- a/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-AWS-Account-object-response.yml +++ b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-AWS-Account-object-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Wed, 06 Aug 2025 17:41:51 GMT +- recorded_at: Wed, 10 Dec 2025 17:40:36 GMT request: body: encoding: UTF-8 @@ -14,43 +14,43 @@ http_interactions: response: body: encoding: UTF-8 - 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 status: code: 200 message: OK -- recorded_at: Wed, 06 Aug 2025 17:41:51 GMT +- recorded_at: Wed, 10 Dec 2025 17:40:36 GMT request: body: encoding: UTF-8 - string: '{"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"}}' + string: '{"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: encoding: UTF-8 - 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 status: code: 200 message: OK -- recorded_at: Wed, 06 Aug 2025 17:41:51 GMT +- recorded_at: Wed, 10 Dec 2025 17:40:36 GMT request: body: null headers: 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: encoding: UTF-8 diff --git a/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Bad-Request-response.frozen b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Bad-Request-response.frozen index 2ad05fcd48b..e550a602216 100644 --- a/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Bad-Request-response.frozen +++ b/cassettes/features/v2/aws_integration/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/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Bad-Request-response.yml b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Bad-Request-response.yml index 83f8744f929..0d6d19af9ea 100644 --- a/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Bad-Request-response.yml +++ b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Bad-Request-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Wed, 06 Aug 2025 17:41:53 GMT +- recorded_at: Wed, 10 Dec 2025 17:42:50 GMT request: body: encoding: UTF-8 @@ -14,44 +14,45 @@ http_interactions: response: body: encoding: UTF-8 - 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 status: code: 200 message: OK -- recorded_at: Wed, 06 Aug 2025 17:41:53 GMT +- recorded_at: Wed, 10 Dec 2025 17:42:50 GMT request: body: encoding: UTF-8 - string: '{"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"}}' + string: '{"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: encoding: UTF-8 - 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 status: code: 400 message: Bad Request -- recorded_at: Wed, 06 Aug 2025 17:41:53 GMT +- recorded_at: Wed, 10 Dec 2025 17:42:50 GMT request: body: null headers: 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: encoding: UTF-8 diff --git a/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Not-Found-response.frozen b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Not-Found-response.frozen index 8c2f55ecb19..07ac47cd4ec 100644 --- a/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Not-Found-response.frozen +++ b/cassettes/features/v2/aws_integration/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/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Not-Found-response.yml b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Not-Found-response.yml index 02e784a97c0..99d068bfe34 100644 --- a/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Not-Found-response.yml +++ b/cassettes/features/v2/aws_integration/Update-an-AWS-integration-returns-Not-Found-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Wed, 06 Aug 2025 17:41:54 GMT +- recorded_at: Wed, 10 Dec 2025 17:43:13 GMT request: body: encoding: UTF-8 - string: '{"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"}}' + string: '{"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/examples/v2/aws-integration/CreateAWSAccount.rb b/examples/v2/aws-integration/CreateAWSAccount.rb index 0c3d16d03a1..d3fef8de4bb 100644 --- a/examples/v2/aws-integration/CreateAWSAccount.rb +++ b/examples/v2/aws-integration/CreateAWSAccount.rb @@ -15,6 +15,17 @@ }), aws_account_id: "123456789012", aws_partition: DatadogAPIClient::V2::AWSAccountPartition::AWS, + ccm_config: DatadogAPIClient::V2::AWSCCMConfig.new({ + data_export_configs: [ + DatadogAPIClient::V2::DataExportConfig.new({ + bucket_name: "my-bucket", + bucket_region: "us-east-1", + report_name: "my-report", + report_prefix: "reports", + report_type: "CUR2.0", + }), + ], + }), logs_config: DatadogAPIClient::V2::AWSLogsConfig.new({ lambda_forwarder: DatadogAPIClient::V2::AWSLambdaForwarderConfig.new({ lambdas: [ diff --git a/examples/v2/aws-integration/CreateAWSAccount_1716720881.rb b/examples/v2/aws-integration/CreateAWSAccount_1716720881.rb index 5a4fa555447..c885185ef60 100644 --- a/examples/v2/aws-integration/CreateAWSAccount_1716720881.rb +++ b/examples/v2/aws-integration/CreateAWSAccount_1716720881.rb @@ -14,6 +14,17 @@ }), aws_account_id: "123456789012", aws_partition: DatadogAPIClient::V2::AWSAccountPartition::AWS, + ccm_config: DatadogAPIClient::V2::AWSCCMConfig.new({ + data_export_configs: [ + DatadogAPIClient::V2::DataExportConfig.new({ + bucket_name: "my-bucket", + bucket_region: "us-east-1", + report_name: "my-report", + report_prefix: "reports", + report_type: "CUR2.0", + }), + ], + }), logs_config: DatadogAPIClient::V2::AWSLogsConfig.new({ lambda_forwarder: DatadogAPIClient::V2::AWSLambdaForwarderConfig.new({ lambdas: [ diff --git a/examples/v2/aws-integration/UpdateAWSAccount.rb b/examples/v2/aws-integration/UpdateAWSAccount.rb index 1e7596a9e80..b0f95eb6af4 100644 --- a/examples/v2/aws-integration/UpdateAWSAccount.rb +++ b/examples/v2/aws-integration/UpdateAWSAccount.rb @@ -17,6 +17,17 @@ }), aws_account_id: "123456789012", aws_partition: DatadogAPIClient::V2::AWSAccountPartition::AWS, + ccm_config: DatadogAPIClient::V2::AWSCCMConfig.new({ + data_export_configs: [ + DatadogAPIClient::V2::DataExportConfig.new({ + bucket_name: "updated-bucket", + bucket_region: "us-west-2", + report_name: "updated-report", + report_prefix: "cost-reports", + report_type: "CUR2.0", + }), + ], + }), logs_config: DatadogAPIClient::V2::AWSLogsConfig.new({ lambda_forwarder: DatadogAPIClient::V2::AWSLambdaForwarderConfig.new({ lambdas: [ diff --git a/features/v2/aws_integration.feature b/features/v2/aws_integration.feature index 30ded64d73f..9e14d0824b3 100644 --- a/features/v2/aws_integration.feature +++ b/features/v2/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 diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 1d65dc8de94..2348ce46a0c 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1193,6 +1193,7 @@ def overrides "v2.aws_auth_config" => "AWSAuthConfig", "v2.aws_auth_config_keys" => "AWSAuthConfigKeys", "v2.aws_auth_config_role" => "AWSAuthConfigRole", + "v2.awsccm_config" => "AWSCCMConfig", "v2.aws_credentials" => "AWSCredentials", "v2.aws_credentials_update" => "AWSCredentialsUpdate", "v2.aws_cur_config" => "AwsCURConfig", @@ -1884,6 +1885,7 @@ def overrides "v2.datadog_integration" => "DatadogIntegration", "v2.datadog_integration_type" => "DatadogIntegrationType", "v2.datadog_integration_update" => "DatadogIntegrationUpdate", + "v2.data_export_config" => "DataExportConfig", "v2.data_relationships_teams" => "DataRelationshipsTeams", "v2.data_relationships_teams_data_items" => "DataRelationshipsTeamsDataItems", "v2.data_relationships_teams_data_items_type" => "DataRelationshipsTeamsDataItemsType", diff --git a/lib/datadog_api_client/v2/models/aws_account_create_request_attributes.rb b/lib/datadog_api_client/v2/models/aws_account_create_request_attributes.rb index d64c59594ee..b2fe1d1797c 100644 --- a/lib/datadog_api_client/v2/models/aws_account_create_request_attributes.rb +++ b/lib/datadog_api_client/v2/models/aws_account_create_request_attributes.rb @@ -38,6 +38,9 @@ class AWSAccountCreateRequestAttributes # AWS Regions to collect data from. Defaults to `include_all`. attr_accessor :aws_regions + # AWS Cloud Cost Management config. + attr_accessor :ccm_config + # AWS Logs Collection config. attr_accessor :logs_config @@ -61,6 +64,7 @@ def self.attribute_map :'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', @@ -77,6 +81,7 @@ def self.openapi_types :'aws_account_id' => :'String', :'aws_partition' => :'AWSAccountPartition', :'aws_regions' => :'AWSRegions', + :'ccm_config' => :'AWSCCMConfig', :'logs_config' => :'AWSLogsConfig', :'metrics_config' => :'AWSMetricsConfig', :'resources_config' => :'AWSResourcesConfig', @@ -132,6 +137,10 @@ def initialize(attributes = {}) self.aws_regions = attributes[:'aws_regions'] end + if attributes.key?(:'ccm_config') + self.ccm_config = attributes[:'ccm_config'] + end + if attributes.key?(:'logs_config') self.logs_config = attributes[:'logs_config'] end @@ -220,6 +229,7 @@ def ==(o) aws_account_id == o.aws_account_id && aws_partition == o.aws_partition && aws_regions == o.aws_regions && + ccm_config == o.ccm_config && logs_config == o.logs_config && metrics_config == o.metrics_config && resources_config == o.resources_config && @@ -231,7 +241,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [account_tags, auth_config, aws_account_id, aws_partition, aws_regions, logs_config, metrics_config, resources_config, traces_config, additional_properties].hash + [account_tags, auth_config, aws_account_id, aws_partition, aws_regions, ccm_config, logs_config, metrics_config, resources_config, traces_config, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/aws_account_response_attributes.rb b/lib/datadog_api_client/v2/models/aws_account_response_attributes.rb index 9063205acd0..149bcad2a50 100644 --- a/lib/datadog_api_client/v2/models/aws_account_response_attributes.rb +++ b/lib/datadog_api_client/v2/models/aws_account_response_attributes.rb @@ -38,6 +38,9 @@ class AWSAccountResponseAttributes # AWS Regions to collect data from. Defaults to `include_all`. attr_accessor :aws_regions + # AWS Cloud Cost Management config. + attr_accessor :ccm_config + # Timestamp of when the account integration was created. attr_accessor :created_at @@ -67,6 +70,7 @@ def self.attribute_map :'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', @@ -85,6 +89,7 @@ def self.openapi_types :'aws_account_id' => :'String', :'aws_partition' => :'AWSAccountPartition', :'aws_regions' => :'AWSRegions', + :'ccm_config' => :'AWSCCMConfig', :'created_at' => :'Time', :'logs_config' => :'AWSLogsConfig', :'metrics_config' => :'AWSMetricsConfig', @@ -142,6 +147,10 @@ def initialize(attributes = {}) self.aws_regions = attributes[:'aws_regions'] end + if attributes.key?(:'ccm_config') + self.ccm_config = attributes[:'ccm_config'] + end + if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end @@ -216,6 +225,7 @@ def ==(o) aws_account_id == o.aws_account_id && aws_partition == o.aws_partition && aws_regions == o.aws_regions && + ccm_config == o.ccm_config && created_at == o.created_at && logs_config == o.logs_config && metrics_config == o.metrics_config && @@ -229,7 +239,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [account_tags, auth_config, aws_account_id, aws_partition, aws_regions, created_at, logs_config, metrics_config, modified_at, resources_config, traces_config, additional_properties].hash + [account_tags, auth_config, aws_account_id, aws_partition, aws_regions, ccm_config, created_at, logs_config, metrics_config, modified_at, resources_config, traces_config, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/aws_account_update_request_attributes.rb b/lib/datadog_api_client/v2/models/aws_account_update_request_attributes.rb index efbdfdda1f8..450ac815b5d 100644 --- a/lib/datadog_api_client/v2/models/aws_account_update_request_attributes.rb +++ b/lib/datadog_api_client/v2/models/aws_account_update_request_attributes.rb @@ -38,6 +38,9 @@ class AWSAccountUpdateRequestAttributes # AWS Regions to collect data from. Defaults to `include_all`. attr_accessor :aws_regions + # AWS Cloud Cost Management config. + attr_accessor :ccm_config + # AWS Logs Collection config. attr_accessor :logs_config @@ -61,6 +64,7 @@ def self.attribute_map :'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', @@ -77,6 +81,7 @@ def self.openapi_types :'aws_account_id' => :'String', :'aws_partition' => :'AWSAccountPartition', :'aws_regions' => :'AWSRegions', + :'ccm_config' => :'AWSCCMConfig', :'logs_config' => :'AWSLogsConfig', :'metrics_config' => :'AWSMetricsConfig', :'resources_config' => :'AWSResourcesConfig', @@ -132,6 +137,10 @@ def initialize(attributes = {}) self.aws_regions = attributes[:'aws_regions'] end + if attributes.key?(:'ccm_config') + self.ccm_config = attributes[:'ccm_config'] + end + if attributes.key?(:'logs_config') self.logs_config = attributes[:'logs_config'] end @@ -198,6 +207,7 @@ def ==(o) aws_account_id == o.aws_account_id && aws_partition == o.aws_partition && aws_regions == o.aws_regions && + ccm_config == o.ccm_config && logs_config == o.logs_config && metrics_config == o.metrics_config && resources_config == o.resources_config && @@ -209,7 +219,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [account_tags, auth_config, aws_account_id, aws_partition, aws_regions, logs_config, metrics_config, resources_config, traces_config, additional_properties].hash + [account_tags, auth_config, aws_account_id, aws_partition, aws_regions, ccm_config, logs_config, metrics_config, resources_config, traces_config, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/awsccm_config.rb b/lib/datadog_api_client/v2/models/awsccm_config.rb new file mode 100644 index 00000000000..e0827aa3fb1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/awsccm_config.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Cloud Cost Management config. + class AWSCCMConfig + include BaseGenericModel + + # List of data export configurations for Cost and Usage Reports. + attr_accessor :data_export_configs + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_export_configs' => :'data_export_configs' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_export_configs' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSCCMConfig` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data_export_configs') + if (value = attributes[:'data_export_configs']).is_a?(Array) + self.data_export_configs = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data_export_configs == o.data_export_configs && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_export_configs, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/data_export_config.rb b/lib/datadog_api_client/v2/models/data_export_config.rb new file mode 100644 index 00000000000..3cfcda87927 --- /dev/null +++ b/lib/datadog_api_client/v2/models/data_export_config.rb @@ -0,0 +1,145 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Cost and Usage Report data export configuration. + class DataExportConfig + include BaseGenericModel + + # Name of the S3 bucket where the Cost and Usage Report is stored. + attr_accessor :bucket_name + + # AWS region of the S3 bucket. + attr_accessor :bucket_region + + # Name of the Cost and Usage Report. + attr_accessor :report_name + + # S3 prefix where the Cost and Usage Report is stored. + attr_accessor :report_prefix + + # Type of the Cost and Usage Report. + attr_accessor :report_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'bucket_name' => :'bucket_name', + :'bucket_region' => :'bucket_region', + :'report_name' => :'report_name', + :'report_prefix' => :'report_prefix', + :'report_type' => :'report_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'bucket_name' => :'String', + :'bucket_region' => :'String', + :'report_name' => :'String', + :'report_prefix' => :'String', + :'report_type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DataExportConfig` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'bucket_name') + self.bucket_name = attributes[:'bucket_name'] + end + + if attributes.key?(:'bucket_region') + self.bucket_region = attributes[:'bucket_region'] + end + + if attributes.key?(:'report_name') + self.report_name = attributes[:'report_name'] + end + + if attributes.key?(:'report_prefix') + self.report_prefix = attributes[:'report_prefix'] + end + + if attributes.key?(:'report_type') + self.report_type = attributes[:'report_type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + bucket_name == o.bucket_name && + bucket_region == o.bucket_region && + report_name == o.report_name && + report_prefix == o.report_prefix && + report_type == o.report_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [bucket_name, bucket_region, report_name, report_prefix, report_type, additional_properties].hash + end + end +end