cormacrelf / terraform-provider-zerotier

Create, modify and destroy ZeroTier networks and members through Terraform.
128 stars 25 forks source link

Avoid diffs due to order of elements returned by the controller #11

Open bltavares opened 5 years ago

bltavares commented 5 years ago

The network and member resource use a couple of settings which could be defined multiple times.

For example: the assigned ips on a member could change the order, while the semantic means the same.

The provider was using a schema.ListType, which according to the documentation is an ordered list of elements, where the order matter.

On those resource seetings, the order is not relevant, as they are sematically equivalent. There is a schema.SetType which provides an unordered collection of settings, and grants the same order given the same settings.

This commit changes the schema of those resources to use schema.SetType instead of schema.ListType to avoid diff loops depending on the sorting of the response from the API.