uptime-com / terraform-provider-uptime

A Terraform provider that provisions checks via the Uptime.com REST API
MIT License
20 stars 18 forks source link

Backwards-incompatible schema change between 2.0 and 2.1 #36

Closed mikluko closed 1 year ago

mikluko commented 1 year ago

@kpocius commented on #35:

Not sure if this is a separate issue, but after downgrading terraform requirement and upgrading the module, I can successfully run the plan, but I see it's attempting to remove Managed by Terraform comment from all resources and then trying to apply it, I get the following error:

│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to uptime_check_http.example, provider
│ "provider[\"registry.terraform.io/uptime-com/uptime\"]" produced an
│ unexpected new value: .notes: was cty.StringVal(""), but now
│ cty.StringVal("Managed by Terraform").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
mikluko commented 1 year ago

@kpocius I think your resources might have retained "Managed by Terraform" notes from v1.0 of the provider. That wasn’t a problem until in v2.1 notes became empty string by default.

I’m working to come up a viable fix for that. Meanwhile, I’d suggest assigning some value to notes for each problematic resource as a workaround. Even an empty string should work.

UPD: Empty string won’t work. It’s exactly the issue. On API calls empty strings just get dropped because of ,omitempty serializer option.

kpocius commented 1 year ago

That's exactly what I've done, and I can confirm the workaround behaves as expected.