Additionally fixes type of builtin field in the agent groups (it was causing the provider to crash panic: reflect.Set: value of type int is not assignable to type bool).
With typeList, terraform will care about the order of the groups, but with typeSet, order is not important (it's also a set meaning items can't be repeated, which applies here).
Additionally, the default value for type and name should be an empty string. We're sending null and storing that in the state, but then on the next terraform plan, the API will send empty strings in type and name. Terraform will compare that to the nulls in the state and think that there were outside changes made to the resource. If we send empty strings as default, this no longer happens.
My local tests show that this works as expected and terraform won't try to change the order on every run.
Unit tests pass:
? github.com/thousandeyes/terraform-provider-thousandeyes [no test files]
ok github.com/thousandeyes/terraform-provider-thousandeyes/thousandeyes 0.480s
Additionally fixes type of builtin field in the agent groups (it was causing the provider to crash
panic: reflect.Set: value of type int is not assignable to type bool
).This fixes https://github.com/thousandeyes/terraform-provider-thousandeyes/issues/105
TypeList is an ordered list, but users shouldn't have to worry about the order in which group blocks are placed in the resource:
With
typeList
, terraform will care about the order of the groups, but withtypeSet
, order is not important (it's also a set meaning items can't be repeated, which applies here).Additionally, the default value for
type
andname
should be an empty string. We're sendingnull
and storing that in the state, but then on the next terraform plan, the API will send empty strings intype
andname
. Terraform will compare that to thenull
s in the state and think that there were outside changes made to the resource. If we send empty strings as default, this no longer happens.My local tests show that this works as expected and terraform won't try to change the order on every run.
Unit tests pass: