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

enable_samples can not be set #2679

Open
lexicalunit opened this issue Nov 15, 2024 · 1 comment · May be fixed by #2680
Open

enable_samples can not be set #2679

lexicalunit opened this issue Nov 15, 2024 · 1 comment · May be fixed by #2680
Labels

Comments

@lexicalunit
Copy link

Datadog Terraform Provider Version

v3.48.1

Terraform Version

v1.9.7

What resources or data sources are affected?

resource datadog_monitor

Terraform Configuration Files

resource "datadog_monitor" "my-monitor" {
  name    = my-name
  type    = "ci-tests alert"
  message = OMIT
  query   = OMIT
  monitor_thresholds {
    critical = 1
  }
  enable_logs_sample       = false
  enable_samples           = true
  notify_audit             = false
  on_missing_data          = "default"
  restricted_roles         = null
  renotify_statuses        = ["alert", "no data"]
  renotify_interval        = 240
  escalation_message       = ""
  notification_preset_name = "hide_all"
  priority                 = var.priority
}

Relevant debug or panic output

It seems like the enable_samples is supported, but trying to actually use it just gives this error:

$ terraform validate

[...]

│ Error: Value for unconfigurable attribute
│
│   with module.datadog-dev.datadog_monitor.my-monitor,
│   on ../datadog/test-monitors.tf line 61, in resource "datadog_monitor" "my-monitor":
│   61:   enable_samples           = true
│
│ Can't configure a value for "enable_samples": its value will be decided automatically based on the result of applying this configuration.

Expected Behavior

It should enable this setting in the monitor.

Actual Behavior

It does not work.

Steps to Reproduce

terraform validate

Important Factoids

No response

References

No response

@lexicalunit
Copy link
Author

I think this is the issue: https://github.com/DataDog/terraform-provider-datadog/blob/master/datadog/resource_datadog_monitor.go#L335 -- This value should be optional. However in the code it's showing as computed.

@lexicalunit lexicalunit linked a pull request Nov 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant