Open michvllni opened 1 month ago
Ooh, good suggestion! This is the sort of breaking change we might be happy to make for a 1.0 release - or even earlier, perhaps? WDYT @matifali ?
@ethanndickson, I think breaking while we are on 0.0 is okay.x, we can move to 0.1.x and communicate this change in our changelog. This will improve the UX.
Also, @michvllni, besides catching duplication, what else do you think we can achieve by converting this list to a map?
The two main reasons that came to my head are the ones I wrote earlier: Catching duplication and an easier to read plan. Also it is easier to write. Also, as you can probably see in my plan I currently use a workaround to pass in not only strings but also objects, but I think this would be difficult to implement and isn't in the scope of this issue
With an automated state migration, this ends up being relatively painless for end-users, however:
I think breaking while we are on 0.0 is okay.x, we can move to 0.1.x and communicate this change in our changelog. This will improve the UX.
I'm not sure if we should make a breaking change like this before 1.0.
It's worth mentioning that Terraform resources internally use an integer for their schema versioning. Bumping the template resource schema from 0 to 1 would misalign it with the major version of the provider, and I don't think that's what hashicorp intended for us to do.
I also think our users who have already deployed this at relative scale might get a little peeved if we make a breaking change for a minor release version, especially since they do have to modify the config.
Can't forget the possibility that the state migration goes wrong and they're required to re-import the resource, - I think that would certainly feel like a surprising task for a non-major release.
If we discover anything else in the template resource that requires a breaking change before we finalise a 1.0 release, we'll also be able to include it in the same migration.
I agree, best put it in a major release. This is what is done in azurerm and other providers as well
As the tf_vars are unique ( it is not possible to define a value for a variable more than once ) it would make sense to change the type of the tf_vars property in the template resource to a map.
How it is now:
How it could be:
By doing this we could ensure that no variable is defined twice.
It would also greatly improve the plans readability, heres an example:
this could be as simple as
I understand this is a breaking change, but as we are very early in the product life cycle I thought it might be an option to change this now before lots of people use the provider
Edit: Typo