-
Notifications
You must be signed in to change notification settings - Fork 2
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
Resource coderd_template
: key-value pairs should use a map
#121
Comments
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. |
With an automated state migration, this ends up being relatively painless for end-users, however:
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. |
coderd_template
: key-value pairs should use a map
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
The text was updated successfully, but these errors were encountered: