DataDog / terraform-provider-datadog

Terraform Datadog provider
https://www.terraform.io/docs/providers/datadog/
Mozilla Public License 2.0
399 stars 375 forks source link

"object contains unparsed element" Error when using datadog_security_monitoring_default_rule #2517

Closed nheffern closed 1 month ago

nheffern commented 1 month ago

Datadog Terraform Provider Version

v3.42.0

Terraform Version

v1.5.7

What resources or data sources are affected?

datadog_security_monitoring_default_rule

Terraform Configuration Files

resource "datadog_security_monitoring_default_rule" "aws_guardduty_finding" {
  enabled = true
  options {
    decrease_criticality_based_on_env = "false"
  }
  case {
    status        = "medium"
    notifications = ["@webhook"]
  }
    case {
    status        = "low"
    notifications = ["@webhook"]
  }
    case {
    status        = "info"
    notifications = ["@webhook"]
  }

}

Relevant debug or panic output

│ Error: object contains unparsed element: map[cases:[map[name: notifications:[] status:info] map[name: notifications:[] status:low] map[name: notifications:[] status:medium] map[name: notifications:[] status:high]] createdAt:1.645432333151e+12 creationAuthorId:0 defaultTags:[iaas:aws source:guardduty] filters:[] hasExtendedTitle:true id:[MASKED] isBeta:false isDefault:true isDeleted:false isDeprecated:false isEnabled:true isPartner:false message:## Goal │ Detect when an [AWS GuardDuty finding][1] has been raised. │ │ ## Strategy │ AWS GuardDuty is a native threat detection service that monitors: │

Expected Behavior

The job should complete and run.

Actual Behavior

Running a terraform plan (on completely unrelated resources) in the same project causes the aforementioned failure.

Steps to Reproduce

terraform plan in a project containing the resource datadog_security_monitoring_default_rule

Important Factoids

No response

References

No response

![Uploading Screenshot 2024-08-02 at 12.27.44.png…]()

nheffern commented 1 month ago

Finding was deprecated which results in this response. Once removed from the state worked as expectd. Perhaps could handle this error in a more graceful manner.