Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use monitor_id for datadog_downtime_schedule resource #2343

Closed
alastair-smith opened this issue Apr 2, 2024 · 1 comment
Closed

Can't use monitor_id for datadog_downtime_schedule resource #2343

alastair-smith opened this issue Apr 2, 2024 · 1 comment
Labels

Comments

@alastair-smith
Copy link

Datadog Terraform Provider Version

3.29.0

Terraform Version

1.5.7

What resources or data sources are affected?

resource_datadog_downtime_schedule

Terraform Configuration Files

resource "datadog_monitor" "monitor" {
  enable_logs_sample = true
  message            = <<EOF
{{#is_alert}}**REDACTED**{{/is_alert}} 
  EOF
  name               = "**READACTED**"
  query              = "logs(\"**READACTED**\").index(\"*\").rollup(\"count\").last(\"1455m\") < 1"
  renotify_interval  = (60 * 24) + 30 # 1 day and 30 minutes
  tags               = ["team:**READACTED**"]
  type               = "log alert"

  monitor_thresholds {
    critical = 1
  }
}

resource "datadog_downtime_schedule" "schedule" {
  scope            = "*"
  display_timezone = "Europe/London"
  message          = "No notifications are expected to be sent over the weekend"

  monitor_identifier {
    monitor_id = datadog_monitor.monitor.id
  }

  recurring_schedule {
    recurrence {
      # All day Sat + All day Sun + Monday morning until 10:35am
      duration = "${tostring(((24 + 24 + 10) * 60) + 35)}m"
      rrule    = "FREQ=WEEKLY;INTERVAL=1"
      # When creating the resource the start date must be in the future, but for updates can be in the past
      start = "2024-04-06T00:00:00"
    }
    timezone = "Europe/London"
  }
}

Relevant debug or panic output

│ Error: Value Conversion Error

│ with module.staging_alerts.datadog_downtime_schedule.notify_function_triggered_downtime,
│ on ../modules/alerts/notify_function_triggered_alerts.tf line 28, in resource "datadog_downtime_schedule" "schedule":
│ 28: monitor_identifier {

│ An unexpected error was encountered while verifying an attribute value
│ matched its expected type to prevent unexpected behavior or panics. This is
│ always an error in the provider. Please report the following to the
│ provider developer:

│ Expected framework type from provider logic:
│ types.SetType[basetypes.StringType] / underlying type:
│ tftypes.Set[tftypes.String]
│ Received framework type from provider logic: types.SetType[!!! MISSING TYPE
│ !!!] / underlying type: tftypes.Set[tftypes.DynamicPseudoType]
│ Path: monitor_identifier.monitor_tags

Expected Behavior

Should have applied the downtime to the monitor based on the id, should not require the tags

Actual Behavior

Failed to apply terraform

Steps to Reproduce

  1. terraform apply

Important Factoids

I don't think many people are using this resource so likely is just broken

References

No response

@skarimo
Copy link
Member

skarimo commented Apr 11, 2024

Hello, this was resolved by: #2092
Please update to the latest version. Im going to close this issue but feel free to followup if needed.

@skarimo skarimo closed this as completed Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants