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

object contains unparsed element in datadog_service_level_objective resource #2377

Closed
dgdelahera opened this issue Apr 22, 2024 · 9 comments
Closed
Assignees
Labels

Comments

@dgdelahera
Copy link

dgdelahera commented Apr 22, 2024

Datadog Terraform Provider Version

v3.38.0

Terraform Version

v1.4.2

What resources or data sources are affected?

  • datadog_service_level_objective

Terraform Configuration Files

We are using a module to create this resource. However, this error is happening when type is metric

resource "datadog_service_level_objective" "main" {
  name        = "[${var.account_name}][${local.service}] ${var.name} (${var.environment})"
  type        = var.query != null ? "metric" : "monitor"
  description = "${var.description} (version: ${var.service_version})"

  monitor_ids = var.monitor_ids

  dynamic "query" {
    for_each = var.query == null ? [] : [0]

    content {
      numerator   = lookup(var.query, "numerator", null)
      denominator = lookup(var.query, "denominator", null)
    }
  }

  timeframe         = var.thresholds.0.timeframe
  target_threshold  = var.thresholds.0.target
  warning_threshold = var.thresholds.0.warning

  dynamic "thresholds" {
    for_each = toset(var.thresholds)

    content {
      timeframe = thresholds.value.timeframe
      target    = thresholds.value.target
      warning   = thresholds.value.warning
    }
  }

  tags = local.dd_tags
}

Relevant debug or panic output

Error: object contains unparsed element: map[count:map[good_events_query:map[formulas:[map[formula:query1]] queries:[map[data_source:metrics name:query1 query:sum:aws.iot.success{account:<REDACTED>}by{actiontype,rulename}.as_count()]]] total_events_query:map[formulas:[map[formula:(query1 + query2)]] queries:[map[data_source:metrics name:query1 query:sum:aws.iot.success{account:<REDACTED>}by{actiontype,rulename}.as_count()] map[data_source:metrics name:query2 query:sum:aws.iot.failure{account:<REDACTED>}by{actiontype,rulename}.as_count()]]]]]
 
   with module.<REDACTED>[0].datadog_service_level_objective.main,
   on .terraform/modules/<REDACTED>/main.tf line 56, in resource "datadog_service_level_objective" "main":
   56: resource "datadog_service_level_objective" "main" {

Expected Behavior

plan/apply succeeds without error

Actual Behavior

plan/apply terminates with an error.

Steps to Reproduce

The error started showing up today:

  1. Do a terraform plan or terraform apply

Important Factoids

No response

References

No response

@dgdelahera dgdelahera added the bug label Apr 22, 2024
@xebia-progress
Copy link

I am facing the same error.

Datadog Terraform Provider Version
v3.38.0

Terraform Version
v1.7.4

module.service.datadog_service_level_objective.slo[0]: Creating...

│ Error: object contains unparsed element:

I have tried with some of the previous versions of DataDog provider [3.37, 3.36, 3.35] and the same error occurred.
When I browse the /slo page using the DD console, I see that terraform creates a new SLO every time despite the error.

@HantingZhang2
Copy link
Contributor

HantingZhang2 commented Apr 22, 2024

This is due to changes on our backend that no longer send out responses that match the expectation of this resource.
SLOs should be able to be created with this resource despite this error.
We are investigating and will post next steps soon.

@xebia-progress
Copy link

@HantingZhang2 I imported created SLO to the Terraform state this morning and now it seems to be working fine.

@nkzou
Copy link
Contributor

nkzou commented Apr 23, 2024

Hi all, a fix for this was deployed last evening on the API side - things should be fixed now, with no action needed on the end user side. If you're still having issues, please let us know and we will investigate further. Thanks!

@charlesverdad
Copy link

I am seeing a similar error but for a datadog_synthetic_test resource

│ Error: object contains unparsed element: map[password:{{ MY_PASSWORD }} username:{{ MY_USER }}]

@skarimo
Copy link
Member

skarimo commented Apr 25, 2024

@charlesverdad thanks for the report. This is unrelated to the original issue raised, however we are looking into it and will follow up.

@gpkfr
Copy link

gpkfr commented May 2, 2024

the same error occurs on "datadog_logs_archive" :
provider version : 3.39.0

" Error: object contains unparsed element: map[bucket:datadog-rehydrate-tf integration:map[] path:/prod-xenon type:s3]"

@HantingZhang2
Copy link
Contributor

Hi @gpkfr and @charlesverdad , while we investigate the unparsed element issue for the 2 resources, would you mind open up a new issue each with more information such as the tf file you used ? This would also help with tracking because the root cause might be different, thanks.

@nkzou
Copy link
Contributor

nkzou commented Jun 24, 2024

Closing this issue, as the original issue is resolved. If you have additional unparsed object errors in other resources, please open a new issue.

@nkzou nkzou closed this as completed Jun 24, 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

7 participants