terraform-provider-datadog: Can not imported ScreenBoard got an error unmarshal

Hi there,

I’m happy to be able to manage the screenboard with DataDog. But I tried importing an existing board but it got an error. Am I something wrong?

Terraform Version

$ terraform -v
Terraform v0.11.8
+ provider.aws v1.40.0
+ provider.datadog v1.4.0

Affected Resource(s)

  • datadog_screenboard

Terraform Configuration Files

resource "datadog_screenboard" "security_log" {
}

Of course, other resources can be managed.

Expected Behavior

imported screenboard

Actual Behavior

$ terraform import datadog_screenboard.security_log 465952
datadog_screenboard.security_log: Importing from ID "465952"...

Error: datadog_screenboard.security_log (import id: 465952): import datadog_screenboard.security_log (id: 465952): json: cannot unmarshal number into Go struct field Screenboard.height of type string

Steps to Reproduce

only use import .

Important Factoids

maybe any boards cannot import…

aws integration make some boards, can not imported.

References

https://www.terraform.io/docs/providers/datadog/r/screenboard.html

Please tell me if there is any information. Thank you.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 8
  • Comments: 21 (5 by maintainers)

Commits related to this issue

Most upvoted comments

100% experiencing the same issue (can provide screenboard id on request).

with TF_LOG set to trace I get the following:

2018/10/16 19:19:31 [TRACE] dag/walk: walking "datadog_screenboard.test (import id: {{SCREENBOARD_ID}}})"
2018/10/16 19:19:31 [TRACE] vertex 'root.datadog_screenboard.test (import id: {{SCREENBOARD_ID}}})': walking
2018/10/16 19:19:31 [TRACE] vertex 'root.datadog_screenboard.test (import id: {{SCREENBOARD_ID}}})': evaluating
2018/10/16 19:19:31 [TRACE] [walkImport] Entering eval tree: datadog_screenboard.test (import id: {{SCREENBOARD_ID}}})
2018/10/16 19:19:31 [TRACE] root: eval: *terraform.EvalSequence
2018/10/16 19:19:31 [TRACE] root: eval: *terraform.EvalGetProvider
2018/10/16 19:19:31 [TRACE] root: eval: *terraform.EvalImportState
datadog_screenboard.test: Importing from ID "{{SCREENBOARD_ID}}}"...
2018/10/16 19:19:31 [ERROR] root: eval: *terraform.EvalImportState, err: import datadog_screenboard.test (id: {{SCREENBOARD_ID}}}): json: cannot unmarshal number into Go struct field Screenboard.height of type string
2018/10/16 19:19:31 [ERROR] root: eval: *terraform.EvalSequence, err: import datadog_screenboard.test (id: {{SCREENBOARD_ID}}}): json: cannot unmarshal number into Go struct field Screenboard.height of type string
2018/10/16 19:19:31 [TRACE] [walkImport] Exiting eval tree: datadog_screenboard.test (import id: {{SCREENBOARD_ID}}})
2018/10/16 19:19:31 [TRACE] dag/walk: upstream errored, not walking "provider.datadog (close)"

Error: datadog_screenboard.test (import id: {{SCREENBOARD_ID}}}): import datadog_screenboard.test (id: {{SCREENBOARD_ID}}}): json: cannot unmarshal number into Go struct field Screenboard.height of type string


2018/10/16 19:19:31 [DEBUG] plugin: waiting for all plugin processes to complete...
2018-10-16T19:19:31.850+0100 [DEBUG] plugin.terraform-provider-datadog_v1.4.0_x4: 2018/10/16 19:19:31 [ERR] plugin: plugin server: accept unix /tmp/plugin764063003: use of closed network connection
2018-10-16T19:19:31.852+0100 [DEBUG] plugin: plugin process exited: path={{PATH_TO_PROJECT}}/.terraform/plugins/linux_amd64/terraform-provider-datadog_v1.4.0_x4

I also saw an issue with not being able to import a screenboard that had been touched by human hands. Regrettably, WYSIWYG is the easiest way to develop a screenboard.

When I was working with this, I noticed there was a ‘palette_flip’ flip attribute on a host map widget which was defined with a boolean value of ‘true’ in my terraform code, which functions correctly when applied to Datadog, whose value was represented in the JSON (which I could see when editing the screenboard) as the numeral ‘1’. This was causing an error in Datadog when I was trying to modify a clone of this screenboard. When I edited the JSON backend to spell out “true”, the screenboard was happy with it.

I offer this clue in hope that it might help a source maintainer identify where the problem lies.

any update on this error? I’m having the same issue and wanted to manage the boards via terraform