59349cca11
This fixes a seemingly minor issue (GH-255) around plans showing changes when in fact there are none. But in reality this turned out to uncover a really terrible bug. The effect of what was happening was that multiple items in a set were being merged. Now, they were being merged in the right order, so if you didn't have rich types (lists in a set) then you never saw the effect since the later value would overwrite the earlier. But with lists (such as in security groups), you would end up with the lists merging. So, if you had one ingress rule with CIDR blocks and one with SGs, then after the merge both ingress rules would have BOTH CIDR and SGs, resulting in an incorrect plan (GH-255). This fixes the issue by introducing a `getSourceExact` bitflag to the ResourceData source. When this is set, ALL data must come from this level, instead of merging lower levels. In the case of sets and diffs, this is exactly what you want: "Get me the set 'foo' from the config and the config ONLY (not the state or diff or w/e)". Andddddd its fixed. GH-255 |
||
---|---|---|
.. | ||
README.md | ||
provider.go | ||
provider_test.go | ||
resource.go | ||
resource_data.go | ||
resource_data_test.go | ||
resource_test.go | ||
schema.go | ||
schema_test.go | ||
set.go | ||
set_test.go |
README.md
Terraform Helper Lib: schema
The schema
package provides a high-level interface for writing resource
providers for Terraform.
If you're writing a resource provider, we recommend you use this package.
The interface exposed by this package is much friendlier than trying to write to the Terraform API directly. The core Terraform API is low-level and built for maximum flexibility and control, whereas this library is built as a framework around that to more easily write common providers.