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

datadog_screenboard - widget swapping x and y parameters #119

Closed
sudomateo opened this issue Nov 15, 2018 · 2 comments · Fixed by #121
Closed

datadog_screenboard - widget swapping x and y parameters #119

sudomateo opened this issue Nov 15, 2018 · 2 comments · Fixed by #121

Comments

@sudomateo
Copy link

Terraform Version

$ terraform -v
Terraform v0.11.10
+ provider.datadog v1.5.0

Affected Resource(s)

  • datadog_screenboard

Terraform Configuration Files

resource "datadog_screenboard" "example" {
  title     = "Test Screenboard"
  read_only = false

  widget {
    type       = "note"
    x          = 30
    y          = 5
    bgcolor    = "pink"
    text_align = "right"
    font_size  = "36"
    tick       = true
    tick_edge  = "bottom"
    tick_pos   = "50%"
    html       = "<b>test note</b>"
  }
}

Debug Output

https://gist.github.com/sudomateo/65ff1e0d3fd20b7aa73abc04714e522f

Panic Output

N/A

Expected Behavior

The resource should create the widgets in the screenboard at the correct x and y coordinates on the screenboard grid.

Actual Behavior

Terraform seems to be swapping the x and y values for the screenboard widgets.

Steps to Reproduce

  1. Create the main.tf with the content above.
  2. Run terraform init to download the Datadog provider plugin.
  3. Run terraform plan to verify the plan output.
  4. Run terraform apply to apply the plan. Enter yes when prompted.
  5. Note the values Terraform inserts for the x and y parameters for the widgets.
  6. Note the ID of the screenboard.
  7. Check the location of the widget in the Datadog web UI. Note how the widget is not at the proper x and y locations but instead at the swapped location.
  8. Query the Datadog API using curl -X GET "https://api.datadoghq.com/api/v1/screen/${DATADOG_SCREENBOARD_ID}?api_key=${DATADOG_API_KEY}&application_key=${DATADOG_APP_KEY}"
  9. Note how the x and y values queried from the API are swapped from what Terraform reported.

Important Factoids

I have tested this using curl and with the Datadog Python API client.

References

N/A

@masci
Copy link
Contributor

masci commented Nov 15, 2018

This is fixed on go-datadog-api master, see zorkian/go-datadog-api#190, we'll be able to ship it in the next release.

@sudomateo
Copy link
Author

@masci beautiful! Thanks for pointing out the API client fix. I didn't see it when I was poking around in that repo.

masterzen pushed a commit to masterzen/terraform-provider-datadog that referenced this issue Nov 17, 2018
…screenboards

This contains the fixes from PR DataDog#194 and DataDog#195 from
zorkian/go-datadog-api and the necessary changes in the provider.
@masci masci added this to the 1.6.0 milestone Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants