Skip to content

Commit 4518e5c

Browse files
clementgbcnskarimo
andauthored
[datadog_security_monitoring_rules] Deprecate metric field of Security Monitoring Rules (#1604)
* [datadog_security_monitoring_rule] Deprecate metric field of Security Monitoring Rules * deduplicate deprecated description Co-authored-by: Sherzod Karimov <[email protected]>
1 parent 0e42677 commit 4518e5c

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

datadog/resource_datadog_security_monitoring_rule.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,15 @@ func datadogSecurityMonitoringRuleSchema() map[string]*schema.Schema {
240240
},
241241
"metric": {
242242
Type: schema.TypeString,
243+
Deprecated: "Configure `metrics` instead. This attribute will be removed in the next major version of the provider.",
243244
Optional: true,
244-
Description: "The target field to aggregate over when using the `sum`, `max`, or `new_value` aggregations.",
245+
Description: "The target field to aggregate over when using the `sum`, `max`, or `geo_data` aggregations.",
245246
},
246247
"metrics": {
247248
Type: schema.TypeList,
248249
Computed: true,
249250
Optional: true,
250-
Description: "Group of target fields to aggregate over when using the new value aggregations.",
251+
Description: "Group of target fields to aggregate over when using the `sum`, `max`, `geo_data`, or `new_value` aggregations. The `sum`, `max`, and `geo_data` aggregations only accept one value in this list, whereas the `new_value` aggregation accepts up to five values.",
251252
Elem: &schema.Schema{Type: schema.TypeString},
252253
},
253254
"name": {

docs/resources/security_monitoring_rule.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ Optional:
148148
- `aggregation` (String) The aggregation type. For Signal Correlation rules, it must be event_count. Valid values are `count`, `cardinality`, `sum`, `max`, `new_value`, `geo_data`, `event_count`.
149149
- `distinct_fields` (List of String) Field for which the cardinality is measured. Sent as an array.
150150
- `group_by_fields` (List of String) Fields to group by.
151-
- `metric` (String) The target field to aggregate over when using the `sum`, `max`, or `new_value` aggregations.
152-
- `metrics` (List of String) Group of target fields to aggregate over when using the new value aggregations.
151+
- `metric` (String, Deprecated) The target field to aggregate over when using the `sum`, `max`, or `geo_data` aggregations. **Deprecated.** Configure `metrics` instead. This attribute will be removed in the next major version of the provider.
152+
- `metrics` (List of String) Group of target fields to aggregate over when using the `sum`, `max`, `geo_data`, or `new_value` aggregations. The `sum`, `max`, and `geo_data` aggregations only accept one value in this list, whereas the `new_value` aggregation accepts up to five values.
153153
- `name` (String) Name of the query. Not compatible with `new_value` aggregations.
154154

155155
<a id="nestedblock--query--agent_rule"></a>

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module github.com/terraform-providers/terraform-provider-datadog
22

33
require (
4-
github.com/DataDog/datadog-api-client-go/v2 v2.3.2-0.20221013130632-7ce5b4f69ecd
4+
github.com/DataDog/datadog-api-client-go/v2 v2.3.2-0.20221021143944-ddf9f44ef204
55
github.com/DataDog/dd-sdk-go-testing v0.0.0-20211116174033-1cd082e322ad
66
github.com/dnaeon/go-vcr v1.0.1
77
github.com/hashicorp/go-cleanhttp v0.5.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
22
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
33
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
4-
github.com/DataDog/datadog-api-client-go/v2 v2.3.2-0.20221013130632-7ce5b4f69ecd h1:dQYHabZBaVwABfGEs0brELsctqjKpfhwnWIDHb6jETg=
5-
github.com/DataDog/datadog-api-client-go/v2 v2.3.2-0.20221013130632-7ce5b4f69ecd/go.mod h1:98b/MtTwSAr/yhTfhCR1oxAqQ/4tMkdrgKH7fYiDA0g=
4+
github.com/DataDog/datadog-api-client-go/v2 v2.3.2-0.20221021143944-ddf9f44ef204 h1:4XSc1gxiTizlIHRKOfadKCwinMsVr69hto1G2HFc9ns=
5+
github.com/DataDog/datadog-api-client-go/v2 v2.3.2-0.20221021143944-ddf9f44ef204/go.mod h1:98b/MtTwSAr/yhTfhCR1oxAqQ/4tMkdrgKH7fYiDA0g=
66
github.com/DataDog/datadog-go v4.4.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
77
github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q=
88
github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=

0 commit comments

Comments
 (0)