Hey @ryanking,
So, bad news and (slightly) good news.
The bad news is this is kind of the Terraform white whale–a core engineer once joked to me that every few years someone comes along believing they can fix the issue and make it possible to detect a zero value. They are always almost right. But because of the lossy way Terraform stores values it doesn’t actually work in all situations.
The (slightly) good news is that terraform-plugin-go does not inherit this problem, and providers built with it are able to reliable distinguish between not-set (null) and zero values for all types. This is only “slightly” good news because terraform-plugin-go is difficult and very verbose to use, making it not an ideal general-purpose solution. I only mention it for completeness in case the bug is so time-sensitive that that’s the only reasonable workaround and is worth the extra effort. There are future efforts planned to bring this kind of accuracy and faithful representation of data to an approachable development experience like the SDK, but we have nothing to announce at this time.
In the meantime, some providers have found success in using strings instead of numbers, which is a confusing user experience, but unlocks the ability to use ""
to detect “unset” and "0"
for 0. This is far from ideal, but again, is another option that can unblock you immediately.