cloudposse / terraform-datadog-platform

Terraform module to configure and provision Datadog monitors, custom RBAC roles with permissions, Datadog synthetic tests, Datadog child organizations, and other Datadog resources from a YAML configuration, complete with automated tests.
https://cloudposse.com/accelerate
Apache License 2.0
104 stars 55 forks source link

Advanced Scheduling for Datadog Synthetics Non-Functional #100

Closed elx-bob closed 2 weeks ago

elx-bob commented 2 months ago

Describe the Bug

Currently unable to set advanced Scheduling options for Datadog Synthetics. While I can easily set multiple Assertions on a single Synthetic Test, I am not able to set multiple Timeframes when attempting to create an advanced schedule for Synthetics.

Expected Behavior

When passing multiple timeframes into the Synthetics module, multiple timeframes are expected to be set for the Synthetic Test.

Steps to Reproduce

This module's usage was setup based on the provided examples. When passed into the Synthetics module, the below will set one Timeframe for the Synthetic Test.

  options:
    scheduling:
      timeframes:
        day: 1
        from: "07:00"
        to: "16:00"
      timezone: "America/New_York"

If you pass in multiple tiemframes, even though it is a valid YAML, the module errors out.

  options:
    scheduling:
      timeframes:
      - day: 1
        from: "07:00"
        to: "16:00"
      - day: 2
        from: "07:00"
        to: "16:00"
      timezone: "America/New_York"

We could not find a valid pattern for passing in multiple timeframes.

Screenshots

╷ │ Error: Unsupported attribute │ │ on .terraform/modules/datadog_synthetics/modules/synthetics/main.tf line 411, in resource "datadog_synthetics_test" "default": │ 411: day = timeframes.value.day │ ├──────────────── │ │ timeframes.value is tuple with 2 elements │ │ This value does not have any attributes. ╵ ╷ │ Error: Unsupported attribute │ │ on .terraform/modules/datadog_synthetics/modules/synthetics/main.tf line 412, in resource "datadog_synthetics_test" "default": │ 412: from = timeframes.value.from │ ├──────────────── │ │ timeframes.value is tuple with 2 elements │ │ This value does not have any attributes. ╵ ╷ │ Error: Unsupported attribute │ │ on .terraform/modules/datadog_synthetics/modules/synthetics/main.tf line 413, in resource "datadog_synthetics_test" "default": │ 413: to = timeframes.value.to │ ├──────────────── │ │ timeframes.value is tuple with 2 elements │ │ This value does not have any attributes. ╵

Environment

No response

Additional Context

There also do not appear to be any examples of this functionality in the documentation or repository. If this is not an error, could someone show how to properly pass multiple timeframes into the Synthetics module via YAML?

elx-bob commented 2 months ago

If this is not a bug, would someone be available to show how to set multiple timeframes for a Synthetic?

GabisCampana commented 2 weeks ago

@Nuru