terraform/helper/schema
Mitchell Hashimoto 59349cca11 helper/schema: sets must be treated atomically within ResourceData
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
2014-10-11 10:40:54 -07:00
..
README.md helper/schema: README 2014-08-17 20:51:09 -07:00
provider.go helper/schema: Input support 2014-09-29 10:25:43 -07:00
provider_test.go Fix go vet complaints 2014-08-24 21:50:35 -07:00
resource.go ResourceDiff => InstanceDiff 2014-09-17 16:33:24 -07:00
resource_data.go helper/schema: sets must be treated atomically within ResourceData 2014-10-11 10:40:54 -07:00
resource_data_test.go helper/schema: sets must be treated atomically within ResourceData 2014-10-11 10:40:54 -07:00
resource_test.go ResourceDiff => InstanceDiff 2014-09-17 16:33:24 -07:00
schema.go helper/schema: sets must be treated atomically within ResourceData 2014-10-11 10:40:54 -07:00
schema_test.go helper/schema: sets must be treated atomically within ResourceData 2014-10-11 10:40:54 -07:00
set.go helper/schema: set diff tests 2014-08-20 21:09:07 -07:00
set_test.go fmt 2014-08-20 22:24:35 -07:00

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.