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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 51 additions & 5 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4317,8 +4317,16 @@ components:
type: array
namespace_filters:
$ref: "#/components/schemas/AWSNamespaceFilters"
resource_type_tag_filters:
description: AWS Metrics collection resource type tag filters list. Defaults to `[]`.
items:
$ref: "#/components/schemas/AWSResourceTypeTagFilter"
type: array
tag_filters:
description: AWS Metrics collection tag filters list. Defaults to `[]`.
deprecated: true
description: |-
AWS Metrics collection tag filters list. Defaults to `[]`.
Deprecated in favor of `resource_type_tag_filters`. The two fields are mutually exclusive on an account.
items:
$ref: "#/components/schemas/AWSNamespaceTagFilter"
type: array
Expand Down Expand Up @@ -4512,6 +4520,38 @@ components:
required:
- include_only
type: object
AWSResourceTypeTagFilter:
description: |-
AWS Metrics Collection resource type tag filter.
Each filter targets either a specific AWS service's resource types (`service` and
`resource_types`) or custom metrics (`custom`). These two modes are mutually exclusive.
The `expression` defines a tag filter that Datadog uses when collecting metrics from the
resource types of a specified service. Wildcards, such as `?` (match a single character)
and `*` (match multiple characters), and exclusion using `!` before the tag are supported.
For example, `env:production AND instance-type:c?.* AND !region:us-east-1`.
properties:
custom:
description: Whether the tag filter applies to custom metrics. When `true`, `service` and `resource_types` must be omitted.
example: false
type: boolean
expression:
description: The tag filter expression to apply when collecting metrics for the matching resource types.
example: "env:production"
type: string
resource_types:
description: The AWS resource types of the service to which the tag filter applies. Required when `service` is set. Use `*` as the only entry to match all resource types of the service; `*` cannot be combined with specific resource types.
items:
description: An AWS resource type of the service.
example: "instance"
type: string
type: array
service:
description: The AWS service for which the tag filter defined in `expression` will be applied. Required unless `custom` is `true`, and must be set together with `resource_types`.
example: "ec2"
type: string
required:
- expression
type: object
AWSResourcesConfig:
description: AWS Resources Collection config.
properties:
Expand Down Expand Up @@ -187941,8 +187981,11 @@ paths:
- include_only:
- aws.ec2.network_in
namespace: AWS/EC2
tag_filters:
- namespace: AWS/EC2
resource_type_tag_filters:
- expression: env:production
resource_types:
- instance
service: ec2
resources_config:
cloud_security_posture_management_collection: false
extended_collection: true
Expand Down Expand Up @@ -188084,8 +188127,11 @@ paths:
- include_only:
- aws.ec2.network_in
namespace: AWS/EC2
tag_filters:
- namespace: AWS/EC2
resource_type_tag_filters:
- expression: env:production
resource_types:
- instance
service: ec2
resources_config:
cloud_security_posture_management_collection: false
extended_collection: true
Expand Down
11 changes: 6 additions & 5 deletions examples/v2/aws-integration/UpdateAWSAccount.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@
collect_cloudwatch_alarms: true,
collect_custom_metrics: true,
enabled: true,
tag_filters: [
DatadogAPIClient::V2::AWSNamespaceTagFilter.new({
namespace: "AWS/EC2",
tags: [
"key:value",
resource_type_tag_filters: [
DatadogAPIClient::V2::AWSResourceTypeTagFilter.new({
service: "ec2",
resource_types: [
"instance",
],
expression: "env:staging",
}),
],
}),
Expand Down
2 changes: 1 addition & 1 deletion features/v2/aws_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,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", "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, "resource_type_tag_filters": [{"service": "ec2", "resource_types": ["instance"], "expression": "env:staging"}]}, "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

Expand Down
2 changes: 1 addition & 1 deletion features/v2/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@
"parameters": [
{
"name": "body",
"value": "{\n \"data\": {\n \"type\": \"account\",\n \"attributes\": {\n \"account_tags\": [\n \"key:value\"\n ],\n \"auth_config\": {\n \"role_name\": \"DatadogIntegrationRole\"\n },\n \"aws_account_id\": \"123456789012\",\n \"aws_partition\": \"aws\",\n \"aws_regions\": {\n \"include_only\": [\n \"us-east-1\"\n ]\n },\n \"logs_config\": {\n \"lambda_forwarder\": {\n \"lambdas\": [\n \"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"\n ],\n \"sources\": [\n \"s3\"\n ],\n \"log_source_config\": {\n \"tag_filters\": [\n {\n \"source\": \"s3\",\n \"tags\": [\"test:test\"]\n }\n ]\n }\n }\n },\n \"metrics_config\": {\n \"enabled\": true,\n \"automute_enabled\": true,\n \"collect_custom_metrics\": false,\n \"collect_cloudwatch_alarms\": false,\n \"tag_filters\": [\n {\n \"namespace\": \"AWS/EC2\",\n \"tags\": [\n \"key:value\"\n ]\n }\n ],\n \"namespace_filters\": {\n \"include_only\": [\n \"AWS/EC2\"\n ]\n }\n },\n \"resources_config\": {\n \"cloud_security_posture_management_collection\": false,\n \"extended_collection\": false\n },\n \"traces_config\": {\n \"xray_services\": {\n \"include_only\": [\n \"AWS/AppSync\"\n ]\n }\n }\n }\n }\n}"
"value": "{\n \"data\": {\n \"type\": \"account\",\n \"attributes\": {\n \"account_tags\": [\n \"key:value\"\n ],\n \"auth_config\": {\n \"role_name\": \"DatadogIntegrationRole\"\n },\n \"aws_account_id\": \"123456789012\",\n \"aws_partition\": \"aws\",\n \"aws_regions\": {\n \"include_only\": [\n \"us-east-1\"\n ]\n },\n \"logs_config\": {\n \"lambda_forwarder\": {\n \"lambdas\": [\n \"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"\n ],\n \"sources\": [\n \"s3\"\n ],\n \"log_source_config\": {\n \"tag_filters\": [\n {\n \"source\": \"s3\",\n \"tags\": [\"test:test\"]\n }\n ]\n }\n }\n },\n \"metrics_config\": {\n \"enabled\": true,\n \"automute_enabled\": true,\n \"collect_custom_metrics\": false,\n \"collect_cloudwatch_alarms\": false,\n \"resource_type_tag_filters\": [\n {\n \"service\": \"ec2\",\n \"resource_types\": [\n \"instance\"\n ],\n \"expression\": \"env:production\"\n }\n ],\n \"namespace_filters\": {\n \"include_only\": [\n \"AWS/EC2\"\n ]\n }\n },\n \"resources_config\": {\n \"cloud_security_posture_management_collection\": false,\n \"extended_collection\": false\n },\n \"traces_config\": {\n \"xray_services\": {\n \"include_only\": [\n \"AWS/AppSync\"\n ]\n }\n }\n }\n }\n}"
}
],
"step": "there is a valid \"aws_account_v2\" in the system",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@
"collect_cloudwatch_alarms": true,
"collect_custom_metrics": true,
"enabled": true,
"tag_filters": [
"resource_type_tag_filters": [
{
"namespace": "AWS/EC2",
"tags": [
"key:value"
]
"expression": "env:staging",
"resource_types": [
"instance"
],
"service": "ec2"
}
]
},
Expand Down
Loading
Loading