BetterStackHQ / terraform-provider-better-uptime

Apache License 2.0
45 stars 12 forks source link

Error from provider when setting or reading betteruptime_metadata #100

Closed andrewjmurphy closed 1 month ago

andrewjmurphy commented 1 month ago

Provider version 0.10.2

We are using the provider to create and manage a "betteruptime_metadata" resource on a heartbeat

resource "betteruptime_metadata" "this" {
  owner_type = "Heartbeat"
  owner_id   = betteruptime_heartbeat.this.id
  key        = "Runbook"
  value      = "https://example.com"
}

This was working until recently, then yesterday, between runs at 10am UTC and 17:00 UTC the terraform plan started to return this error when fetching the current deployed state:

│ Error: json: cannot unmarshal string into Go struct field metadata.data.attributes.owner_id of type int
│ 
│   with betteruptime_metadata.this,
│   on main.tf line 116, in resource "betteruptime_metadata" "this":
│  116: resource "betteruptime_metadata" "this" {
│ 
╵

It is returned during the "Refreshing state" phase of the terraform run. If we delete the metadata from the deployed heartbeat then it succeeds, but the same error is returned when the apply is run.

PetrHeinz commented 1 month ago

Hello @andrewjmurphy and thanks for reporting the issue 🙌

We're release a fix of the provider in v0.10.3 later today, which will resolve the type incompatibilies. Sorry for the inconvenience.

Then, after running terraform init --upgrade the plan should be empty for your metadata.

PetrHeinz commented 1 month ago

We've just released v0.10.3 which should fix the issue 🎉