hashicorp/terraform — pull request #678 by mitchellh (2014-12-16 01:38:20+00:00)
Title: helper/schema: track map element counts

This adds "field.#" values to the state/diff with the element count of a
map. This fixes a major issue around not knowing when child elements are
computed when doing variable access of a computed map.

Example, if you have a schema like this:

"foo": &Schema{
Type: TypeMap,
Computed: true,
}

And you access it like this in a resource:

${type.name.foo.computed-field}

Then Terraform will error that "field foo could not be found on resource
type.name". By adding that "foo.#" is computed, Terraform core will pick
up that it WILL exist, so its okay.

@svanharmelen Since you've been in helper/schema recently, I'd appreciate a review. Thanks!