From 384269652b045c82bb68491255fd07284e103a87 Mon Sep 17 00:00:00 2001 From: KillerPaperMice Date: Tue, 10 Sep 2024 12:06:52 -0400 Subject: [PATCH 1/5] :sparkles: Add Flex Index Configuration support for Logs Indexes --- datadog/data_source_datadog_logs_indexes.go | 14 ++++++++++---- datadog/resource_datadog_logs_index.go | 17 ++++++++++++++++- .../tests/resource_datadog_logs_index_test.go | 4 ++++ .../resources/datadog_logs_index/resource.tf | 1 + go.mod | 2 +- go.sum | 4 ++-- 6 files changed, 34 insertions(+), 8 deletions(-) diff --git a/datadog/data_source_datadog_logs_indexes.go b/datadog/data_source_datadog_logs_indexes.go index d439108a8..c1ed7bc1e 100644 --- a/datadog/data_source_datadog_logs_indexes.go +++ b/datadog/data_source_datadog_logs_indexes.go @@ -59,7 +59,12 @@ func dataSourceDatadogLogsIndexes() *schema.Resource { Computed: true, }, "retention_days": { - Description: "The number of days before logs are deleted from this index.", + Description: "The number of days logs are stored in Standard Tier before aging into the Flex Tier or being deleted from the index.", + Type: schema.TypeInt, + Computed: true, + }, + "flex_retention_days": { + Description: "The total number of days logs are stored in Standard and Flex Tier before being deleted from the index.", Type: schema.TypeInt, Computed: true, }, @@ -151,9 +156,10 @@ func dataSourceDatadogLogsIndexesRead(ctx context.Context, d *schema.ResourceDat "daily_limit": l.GetDailyLimit(), "daily_limit_reset": buildTerraformIndexDailyLimitReset(l.GetDailyLimitReset()), "daily_limit_warning_threshold_percentage": l.GetDailyLimitWarningThresholdPercentage(), - "retention_days": l.GetNumRetentionDays(), - "filter": buildTerraformIndexFilter(l.GetFilter()), - "exclusion_filter": buildTerraformExclusionFilters(l.GetExclusionFilters()), + "retention_days": l.GetNumRetentionDays(), + "flex_retention_days": l.GetNumFlexLogsRetentionDays(), + "filter": buildTerraformIndexFilter(l.GetFilter()), + "exclusion_filter": buildTerraformExclusionFilters(l.GetExclusionFilters()), } } if err := d.Set("logs_indexes", tfLogsIndexes); err != nil { diff --git a/datadog/resource_datadog_logs_index.go b/datadog/resource_datadog_logs_index.go index 10ceae853..378162e43 100644 --- a/datadog/resource_datadog_logs_index.go +++ b/datadog/resource_datadog_logs_index.go @@ -69,7 +69,13 @@ var indexSchema = map[string]*schema.Schema{ DiffSuppressFunc: suppressDiffWhenDisabledDailyLimit, }, "retention_days": { - Description: "The number of days before logs are deleted from this index.", + Description: "The number of days logs are stored in Standard Tier before aging into the Flex Tier or being deleted from the index.", + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "flex_retention_days": { + Description: "The total number of days logs are stored in Standard and Flex Tier before being deleted from the index.", Type: schema.TypeInt, Optional: true, Computed: true, @@ -202,6 +208,9 @@ func updateLogsIndexState(d *schema.ResourceData, index *datadogV1.LogsIndex) di if err := d.Set("retention_days", index.GetNumRetentionDays()); err != nil { return diag.FromErr(err) } + if err := d.Set("flex_retention_days", index.GetNumFlexLogsRetentionDays()); err != nil { + return diag.FromErr(err) + } if err := d.Set("filter", buildTerraformIndexFilter(index.GetFilter())); err != nil { return diag.FromErr(err) } @@ -275,6 +284,9 @@ func buildDatadogIndexUpdateRequest(d *schema.ResourceData) *datadogV1.LogsIndex if v, ok := d.GetOk("retention_days"); ok { ddIndex.SetNumRetentionDays(int64(v.(int))) } + if v, ok := d.GetOk("flex_retention_days"); ok { + ddIndex.SetNumFlexLogsRetentionDays(int64(v.(int))) + } ddIndex.ExclusionFilters = *buildDatadogExclusionFilters(d.Get("exclusion_filter").([]interface{})) return &ddIndex @@ -300,6 +312,9 @@ func buildDatadogIndexCreateRequest(d *schema.ResourceData) *datadogV1.LogsIndex if v, ok := d.GetOk("retention_days"); ok { ddIndex.SetNumRetentionDays(int64(v.(int))) } + if v, ok := d.GetOk("flex_retention_days"); ok { + ddIndex.SetNumFlexLogsRetentionDays(int64(v.(int))) + } ddIndex.ExclusionFilters = *buildDatadogExclusionFilters(d.Get("exclusion_filter").([]interface{})) return &ddIndex } diff --git a/datadog/tests/resource_datadog_logs_index_test.go b/datadog/tests/resource_datadog_logs_index_test.go index 0d48cd40e..985499d43 100644 --- a/datadog/tests/resource_datadog_logs_index_test.go +++ b/datadog/tests/resource_datadog_logs_index_test.go @@ -39,6 +39,7 @@ func TestAccDatadogLogsIndex_Basic(t *testing.T) { resource.TestCheckResourceAttr("datadog_logs_index.sample_index", "daily_limit_warning_threshold_percentage", "70"), resource.TestCheckResourceAttr("datadog_logs_index.sample_index", "disable_daily_limit", "false"), resource.TestCheckResourceAttr("datadog_logs_index.sample_index", "retention_days", "15"), + // resource.TestCheckResourceAttr("datadog_logs_index.sample_index", "flex_retention_days", "180"), resource.TestCheckResourceAttr("datadog_logs_index.sample_index", "filter.#", "1"), resource.TestCheckResourceAttr("datadog_logs_index.sample_index", "filter.0.query", "non-existent-query"), resource.TestCheckResourceAttr("datadog_logs_index.sample_index", "exclusion_filter.#", "0"), @@ -98,6 +99,7 @@ resource "datadog_logs_index" "sample_index" { } daily_limit_warning_threshold_percentage = 70 retention_days = 15 + flex_retention_days = 180 filter { query = "non-existent-query" } @@ -117,6 +119,7 @@ resource "datadog_logs_index" "sample_index" { daily_limit_warning_threshold_percentage = 99.99 disable_daily_limit = false retention_days = 15 + flex_retention_days = 180 filter { query = "test:query" } @@ -144,6 +147,7 @@ resource "datadog_logs_index" "sample_index" { daily_limit_warning_threshold_percentage = 70 disable_daily_limit = true retention_days = 15 + flex_retention_days = 180 filter { query = "test:query" } diff --git a/examples/resources/datadog_logs_index/resource.tf b/examples/resources/datadog_logs_index/resource.tf index fe2a92057..c69bf5003 100644 --- a/examples/resources/datadog_logs_index/resource.tf +++ b/examples/resources/datadog_logs_index/resource.tf @@ -9,6 +9,7 @@ resource "datadog_logs_index" "sample_index" { } daily_limit_warning_threshold_percentage = 50 retention_days = 7 + flex_retention_days = 180 filter { query = "*" } diff --git a/go.mod b/go.mod index 16c7ad321..9207ced49 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/terraform-providers/terraform-provider-datadog require ( - github.com/DataDog/datadog-api-client-go/v2 v2.30.0 + github.com/DataDog/datadog-api-client-go/v2 v2.30.1-0.20240906212521-ad7f3f6f3f41 github.com/DataDog/dd-sdk-go-testing v0.0.0-20211116174033-1cd082e322ad github.com/Masterminds/semver/v3 v3.1.1 github.com/google/go-cmp v0.5.9 diff --git a/go.sum b/go.sum index 40c3266c8..a66c542f7 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/datadog-api-client-go/v2 v2.30.0 h1:WHAo6RA8CqAzaUh3dERqz/n6SuG2GJ/WthBkccn0MIQ= -github.com/DataDog/datadog-api-client-go/v2 v2.30.0/go.mod h1:QKOu6vscsh87fMY1lHfLEmNSunyXImj8BUaUWJXOehc= +github.com/DataDog/datadog-api-client-go/v2 v2.30.1-0.20240906212521-ad7f3f6f3f41 h1:uWn+uGHvI3uXsulTgyB2GmKjKn4ooUXiiSFSIt/G4e0= +github.com/DataDog/datadog-api-client-go/v2 v2.30.1-0.20240906212521-ad7f3f6f3f41/go.mod h1:QKOu6vscsh87fMY1lHfLEmNSunyXImj8BUaUWJXOehc= github.com/DataDog/datadog-go v4.4.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q= github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= From 561730c0230413aaab8a3052d7163ebf1a52a18a Mon Sep 17 00:00:00 2001 From: KillerPaperMice Date: Tue, 10 Sep 2024 12:22:09 -0400 Subject: [PATCH 2/5] :test_tube: enable flex test for logs indexes --- datadog/tests/resource_datadog_logs_index_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datadog/tests/resource_datadog_logs_index_test.go b/datadog/tests/resource_datadog_logs_index_test.go index 985499d43..b1a8a8d77 100644 --- a/datadog/tests/resource_datadog_logs_index_test.go +++ b/datadog/tests/resource_datadog_logs_index_test.go @@ -39,7 +39,7 @@ func TestAccDatadogLogsIndex_Basic(t *testing.T) { resource.TestCheckResourceAttr("datadog_logs_index.sample_index", "daily_limit_warning_threshold_percentage", "70"), resource.TestCheckResourceAttr("datadog_logs_index.sample_index", "disable_daily_limit", "false"), resource.TestCheckResourceAttr("datadog_logs_index.sample_index", "retention_days", "15"), - // resource.TestCheckResourceAttr("datadog_logs_index.sample_index", "flex_retention_days", "180"), + resource.TestCheckResourceAttr("datadog_logs_index.sample_index", "flex_retention_days", "180"), resource.TestCheckResourceAttr("datadog_logs_index.sample_index", "filter.#", "1"), resource.TestCheckResourceAttr("datadog_logs_index.sample_index", "filter.0.query", "non-existent-query"), resource.TestCheckResourceAttr("datadog_logs_index.sample_index", "exclusion_filter.#", "0"), From c54eed29c7e3811796f910bd336190bd4b5a9ca8 Mon Sep 17 00:00:00 2001 From: KillerPaperMice Date: Tue, 10 Sep 2024 12:22:39 -0400 Subject: [PATCH 3/5] :memo: update Logs Index docs for flex retention support --- docs/data-sources/logs_indexes.md | 1 + docs/resources/logs_index.md | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/data-sources/logs_indexes.md b/docs/data-sources/logs_indexes.md index 62e38240d..e136b829f 100644 --- a/docs/data-sources/logs_indexes.md +++ b/docs/data-sources/logs_indexes.md @@ -34,6 +34,7 @@ Read-Only: - `daily_limit_warning_threshold_percentage` (Number) - `exclusion_filter` (List of Object) (see [below for nested schema](#nestedobjatt--logs_indexes--exclusion_filter)) - `filter` (List of Object) (see [below for nested schema](#nestedobjatt--logs_indexes--filter)) +- `flex_retention_days` (Number) - `name` (String) - `retention_days` (Number) diff --git a/docs/resources/logs_index.md b/docs/resources/logs_index.md index d0e24e401..be45976a2 100644 --- a/docs/resources/logs_index.md +++ b/docs/resources/logs_index.md @@ -25,6 +25,7 @@ resource "datadog_logs_index" "sample_index" { } daily_limit_warning_threshold_percentage = 50 retention_days = 7 + flex_retention_days = 180 filter { query = "*" } @@ -62,7 +63,8 @@ resource "datadog_logs_index" "sample_index" { - `daily_limit_warning_threshold_percentage` (Number) A percentage threshold of the daily quota at which a Datadog warning event is generated. - `disable_daily_limit` (Boolean) If true, sets the daily_limit value to null and the index is not limited on a daily basis (any specified daily_limit value in the request is ignored). If false or omitted, the index's current daily_limit is maintained. - `exclusion_filter` (Block List) List of exclusion filters. (see [below for nested schema](#nestedblock--exclusion_filter)) -- `retention_days` (Number) The number of days before logs are deleted from this index. +- `flex_retention_days` (Number) The total number of days logs are stored in Standard and Flex Tier before being deleted from the index. +- `retention_days` (Number) The number of days logs are stored in Standard Tier before aging into the Flex Tier or being deleted from the index. ### Read-Only From 534168c40dc43e544c22b3ef93fada1edea5a353 Mon Sep 17 00:00:00 2001 From: KillerPaperMice Date: Tue, 10 Sep 2024 14:23:56 -0400 Subject: [PATCH 4/5] :white_check_mark: update test cassettes for log indexes --- .../TestAccDatadogLogsIndex_Basic.freeze | 2 +- .../TestAccDatadogLogsIndex_Basic.yaml | 58 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/datadog/tests/cassettes/TestAccDatadogLogsIndex_Basic.freeze b/datadog/tests/cassettes/TestAccDatadogLogsIndex_Basic.freeze index 559381b49..4906d5d39 100644 --- a/datadog/tests/cassettes/TestAccDatadogLogsIndex_Basic.freeze +++ b/datadog/tests/cassettes/TestAccDatadogLogsIndex_Basic.freeze @@ -1 +1 @@ -2024-02-01T16:44:06.859038+01:00 \ No newline at end of file +2024-09-10T14:21:35.751535-04:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestAccDatadogLogsIndex_Basic.yaml b/datadog/tests/cassettes/TestAccDatadogLogsIndex_Basic.yaml index 0ba50c885..832612b2a 100644 --- a/datadog/tests/cassettes/TestAccDatadogLogsIndex_Basic.yaml +++ b/datadog/tests/cassettes/TestAccDatadogLogsIndex_Basic.yaml @@ -6,14 +6,14 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 286 + content_length: 321 transfer_encoding: [] trailer: {} host: api.datadoghq.com remote_addr: "" request_uri: "" body: | - {"daily_limit":200000,"daily_limit_reset":{"reset_time":"10:00","reset_utc_offset":"+02:00"},"daily_limit_warning_threshold_percentage":70,"exclusion_filters":[],"filter":{"query":"non-existent-query"},"name":"tf-testaccdatadoglogsindex-basic-local-1706802246","num_retention_days":15} + {"daily_limit":200000,"daily_limit_reset":{"reset_time":"10:00","reset_utc_offset":"+02:00"},"daily_limit_warning_threshold_percentage":70,"exclusion_filters":[],"filter":{"query":"non-existent-query"},"name":"tf-testaccdatadoglogsindex-basic-local-1725992495","num_flex_logs_retention_days":180,"num_retention_days":15} form: {} headers: Accept: @@ -32,13 +32,13 @@ interactions: content_length: -1 uncompressed: true body: | - {"name":"tf-testaccdatadoglogsindex-basic-local-1706802246","filter":{"query":"non-existent-query"},"num_retention_days":15,"daily_limit":200000,"is_rate_limited":false,"daily_limit_reset":{"reset_time":"10:00","reset_utc_offset":"+02:00"},"daily_limit_warning_threshold_percentage":70.0,"exclusion_filters":[]} + {"name":"tf-testaccdatadoglogsindex-basic-local-1725992495","filter":{"query":"non-existent-query"},"num_retention_days":15,"daily_limit":200000,"is_rate_limited":false,"daily_limit_reset":{"reset_time":"10:00","reset_utc_offset":"+02:00"},"daily_limit_warning_threshold_percentage":70.0,"exclusion_filters":[],"num_flex_logs_retention_days":180} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 648.244708ms + duration: 267.185125ms - id: 1 request: proto: HTTP/1.1 @@ -55,7 +55,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/logs/config/indexes/tf-testaccdatadoglogsindex-basic-local-1706802246 + url: https://api.datadoghq.com/api/v1/logs/config/indexes/tf-testaccdatadoglogsindex-basic-local-1725992495 method: GET response: proto: HTTP/1.1 @@ -67,13 +67,13 @@ interactions: content_length: -1 uncompressed: true body: | - {"name":"tf-testaccdatadoglogsindex-basic-local-1706802246","filter":{"query":"non-existent-query"},"num_retention_days":15,"daily_limit":200000,"is_rate_limited":false,"daily_limit_reset":{"reset_time":"10:00","reset_utc_offset":"+02:00"},"daily_limit_warning_threshold_percentage":70.0,"exclusion_filters":[]} + {"name":"tf-testaccdatadoglogsindex-basic-local-1725992495","filter":{"query":"non-existent-query"},"num_retention_days":15,"daily_limit":200000,"is_rate_limited":false,"daily_limit_reset":{"reset_time":"10:00","reset_utc_offset":"+02:00"},"daily_limit_warning_threshold_percentage":70.0,"exclusion_filters":[],"num_flex_logs_retention_days":180} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 187.354416ms + duration: 125.18425ms - id: 2 request: proto: HTTP/1.1 @@ -90,7 +90,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/logs/config/indexes/tf-testaccdatadoglogsindex-basic-local-1706802246 + url: https://api.datadoghq.com/api/v1/logs/config/indexes/tf-testaccdatadoglogsindex-basic-local-1725992495 method: GET response: proto: HTTP/1.1 @@ -102,33 +102,33 @@ interactions: content_length: -1 uncompressed: true body: | - {"name":"tf-testaccdatadoglogsindex-basic-local-1706802246","filter":{"query":"non-existent-query"},"num_retention_days":15,"daily_limit":200000,"is_rate_limited":false,"daily_limit_reset":{"reset_time":"10:00","reset_utc_offset":"+02:00"},"daily_limit_warning_threshold_percentage":70.0,"exclusion_filters":[]} + {"name":"tf-testaccdatadoglogsindex-basic-local-1725992495","filter":{"query":"non-existent-query"},"num_retention_days":15,"daily_limit":200000,"is_rate_limited":false,"daily_limit_reset":{"reset_time":"10:00","reset_utc_offset":"+02:00"},"daily_limit_warning_threshold_percentage":70.0,"exclusion_filters":[],"num_flex_logs_retention_days":180} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 171.845459ms + duration: 133.591916ms - id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 321 + content_length: 356 transfer_encoding: [] trailer: {} host: api.datadoghq.com remote_addr: "" request_uri: "" body: | - {"daily_limit":20000,"daily_limit_reset":{"reset_time":"12:00","reset_utc_offset":"-02:00"},"daily_limit_warning_threshold_percentage":99.99,"exclusion_filters":[{"filter":{"query":"app:coredns","sample_rate":0.97},"is_enabled":true,"name":"Filter coredns logs"}],"filter":{"query":"test:query"},"num_retention_days":15} + {"daily_limit":20000,"daily_limit_reset":{"reset_time":"12:00","reset_utc_offset":"-02:00"},"daily_limit_warning_threshold_percentage":99.99,"exclusion_filters":[{"filter":{"query":"app:coredns","sample_rate":0.97},"is_enabled":true,"name":"Filter coredns logs"}],"filter":{"query":"test:query"},"num_flex_logs_retention_days":180,"num_retention_days":15} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/logs/config/indexes/tf-testaccdatadoglogsindex-basic-local-1706802246 + url: https://api.datadoghq.com/api/v1/logs/config/indexes/tf-testaccdatadoglogsindex-basic-local-1725992495 method: PUT response: proto: HTTP/1.1 @@ -140,13 +140,13 @@ interactions: content_length: -1 uncompressed: true body: | - {"name":"tf-testaccdatadoglogsindex-basic-local-1706802246","filter":{"query":"test:query"},"num_retention_days":15,"daily_limit":20000,"is_rate_limited":false,"daily_limit_reset":{"reset_time":"12:00","reset_utc_offset":"-02:00"},"daily_limit_warning_threshold_percentage":99.99,"exclusion_filters":[{"name":"Filter coredns logs","is_enabled":true,"filter":{"query":"app:coredns","sample_rate":0.97}}]} + {"name":"tf-testaccdatadoglogsindex-basic-local-1725992495","filter":{"query":"test:query"},"num_retention_days":15,"daily_limit":20000,"is_rate_limited":false,"daily_limit_reset":{"reset_time":"12:00","reset_utc_offset":"-02:00"},"daily_limit_warning_threshold_percentage":99.99,"exclusion_filters":[{"name":"Filter coredns logs","is_enabled":true,"filter":{"query":"app:coredns","sample_rate":0.97}}],"num_flex_logs_retention_days":180} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 290.800667ms + duration: 135.232042ms - id: 4 request: proto: HTTP/1.1 @@ -163,7 +163,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/logs/config/indexes/tf-testaccdatadoglogsindex-basic-local-1706802246 + url: https://api.datadoghq.com/api/v1/logs/config/indexes/tf-testaccdatadoglogsindex-basic-local-1725992495 method: GET response: proto: HTTP/1.1 @@ -175,13 +175,13 @@ interactions: content_length: -1 uncompressed: true body: | - {"name":"tf-testaccdatadoglogsindex-basic-local-1706802246","filter":{"query":"test:query"},"num_retention_days":15,"daily_limit":20000,"is_rate_limited":false,"daily_limit_reset":{"reset_time":"12:00","reset_utc_offset":"-02:00"},"daily_limit_warning_threshold_percentage":99.99,"exclusion_filters":[{"name":"Filter coredns logs","is_enabled":true,"filter":{"query":"app:coredns","sample_rate":0.97}}]} + {"name":"tf-testaccdatadoglogsindex-basic-local-1725992495","filter":{"query":"test:query"},"num_retention_days":15,"daily_limit":20000,"is_rate_limited":false,"daily_limit_reset":{"reset_time":"12:00","reset_utc_offset":"-02:00"},"daily_limit_warning_threshold_percentage":99.99,"exclusion_filters":[{"name":"Filter coredns logs","is_enabled":true,"filter":{"query":"app:coredns","sample_rate":0.97}}],"num_flex_logs_retention_days":180} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 179.5485ms + duration: 128.066125ms - id: 5 request: proto: HTTP/1.1 @@ -198,7 +198,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/logs/config/indexes/tf-testaccdatadoglogsindex-basic-local-1706802246 + url: https://api.datadoghq.com/api/v1/logs/config/indexes/tf-testaccdatadoglogsindex-basic-local-1725992495 method: GET response: proto: HTTP/1.1 @@ -210,33 +210,33 @@ interactions: content_length: -1 uncompressed: true body: | - {"name":"tf-testaccdatadoglogsindex-basic-local-1706802246","filter":{"query":"test:query"},"num_retention_days":15,"daily_limit":20000,"is_rate_limited":false,"daily_limit_reset":{"reset_time":"12:00","reset_utc_offset":"-02:00"},"daily_limit_warning_threshold_percentage":99.99,"exclusion_filters":[{"name":"Filter coredns logs","is_enabled":true,"filter":{"query":"app:coredns","sample_rate":0.97}}]} + {"name":"tf-testaccdatadoglogsindex-basic-local-1725992495","filter":{"query":"test:query"},"num_retention_days":15,"daily_limit":20000,"is_rate_limited":false,"daily_limit_reset":{"reset_time":"12:00","reset_utc_offset":"-02:00"},"daily_limit_warning_threshold_percentage":99.99,"exclusion_filters":[{"name":"Filter coredns logs","is_enabled":true,"filter":{"query":"app:coredns","sample_rate":0.97}}],"num_flex_logs_retention_days":180} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 193.31175ms + duration: 64.196958ms - id: 6 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 248 + content_length: 283 transfer_encoding: [] trailer: {} host: api.datadoghq.com remote_addr: "" request_uri: "" body: | - {"daily_limit":20000,"daily_limit_reset":{"reset_time":"12:00","reset_utc_offset":"-02:00"},"daily_limit_warning_threshold_percentage":99.99,"disable_daily_limit":true,"exclusion_filters":[],"filter":{"query":"test:query"},"num_retention_days":15} + {"daily_limit":20000,"daily_limit_reset":{"reset_time":"12:00","reset_utc_offset":"-02:00"},"daily_limit_warning_threshold_percentage":99.99,"disable_daily_limit":true,"exclusion_filters":[],"filter":{"query":"test:query"},"num_flex_logs_retention_days":180,"num_retention_days":15} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/logs/config/indexes/tf-testaccdatadoglogsindex-basic-local-1706802246 + url: https://api.datadoghq.com/api/v1/logs/config/indexes/tf-testaccdatadoglogsindex-basic-local-1725992495 method: PUT response: proto: HTTP/1.1 @@ -248,13 +248,13 @@ interactions: content_length: -1 uncompressed: true body: | - {"name":"tf-testaccdatadoglogsindex-basic-local-1706802246","filter":{"query":"test:query"},"num_retention_days":15,"daily_limit":null,"is_rate_limited":false,"daily_limit_reset":null,"daily_limit_warning_threshold_percentage":null,"exclusion_filters":[]} + {"name":"tf-testaccdatadoglogsindex-basic-local-1725992495","filter":{"query":"test:query"},"num_retention_days":15,"daily_limit":null,"is_rate_limited":false,"daily_limit_reset":null,"daily_limit_warning_threshold_percentage":null,"exclusion_filters":[],"num_flex_logs_retention_days":180} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 254.154334ms + duration: 124.066417ms - id: 7 request: proto: HTTP/1.1 @@ -271,7 +271,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/logs/config/indexes/tf-testaccdatadoglogsindex-basic-local-1706802246 + url: https://api.datadoghq.com/api/v1/logs/config/indexes/tf-testaccdatadoglogsindex-basic-local-1725992495 method: GET response: proto: HTTP/1.1 @@ -283,10 +283,10 @@ interactions: content_length: -1 uncompressed: true body: | - {"name":"tf-testaccdatadoglogsindex-basic-local-1706802246","filter":{"query":"test:query"},"num_retention_days":15,"daily_limit":null,"is_rate_limited":false,"daily_limit_reset":null,"daily_limit_warning_threshold_percentage":null,"exclusion_filters":[]} + {"name":"tf-testaccdatadoglogsindex-basic-local-1725992495","filter":{"query":"test:query"},"num_retention_days":15,"daily_limit":null,"is_rate_limited":false,"daily_limit_reset":null,"daily_limit_warning_threshold_percentage":null,"exclusion_filters":[],"num_flex_logs_retention_days":180} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 179.168042ms + duration: 65.029083ms From a18a8bff7e8fa4e6d99255b32ab5074fb8f76d04 Mon Sep 17 00:00:00 2001 From: KillerPaperMice Date: Tue, 10 Sep 2024 14:40:03 -0400 Subject: [PATCH 5/5] :rewind: remove api version bumps --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9207ced49..16c7ad321 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/terraform-providers/terraform-provider-datadog require ( - github.com/DataDog/datadog-api-client-go/v2 v2.30.1-0.20240906212521-ad7f3f6f3f41 + github.com/DataDog/datadog-api-client-go/v2 v2.30.0 github.com/DataDog/dd-sdk-go-testing v0.0.0-20211116174033-1cd082e322ad github.com/Masterminds/semver/v3 v3.1.1 github.com/google/go-cmp v0.5.9 diff --git a/go.sum b/go.sum index a66c542f7..40c3266c8 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/datadog-api-client-go/v2 v2.30.1-0.20240906212521-ad7f3f6f3f41 h1:uWn+uGHvI3uXsulTgyB2GmKjKn4ooUXiiSFSIt/G4e0= -github.com/DataDog/datadog-api-client-go/v2 v2.30.1-0.20240906212521-ad7f3f6f3f41/go.mod h1:QKOu6vscsh87fMY1lHfLEmNSunyXImj8BUaUWJXOehc= +github.com/DataDog/datadog-api-client-go/v2 v2.30.0 h1:WHAo6RA8CqAzaUh3dERqz/n6SuG2GJ/WthBkccn0MIQ= +github.com/DataDog/datadog-api-client-go/v2 v2.30.0/go.mod h1:QKOu6vscsh87fMY1lHfLEmNSunyXImj8BUaUWJXOehc= github.com/DataDog/datadog-go v4.4.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q= github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=