Merge pull request #11577 from hashicorp/f-diff-meta

terraform: add Meta field to diffs
This commit is contained in:
Mitchell Hashimoto 2017-01-31 15:51:02 -08:00 committed by GitHub
commit c503caa4ad
2 changed files with 10 additions and 0 deletions

View File

@ -364,6 +364,12 @@ type InstanceDiff struct {
Destroy bool
DestroyDeposed bool
DestroyTainted bool
// Meta is a simple K/V map that is stored in a diff and persisted to
// plans but otherwise is completely ignored by Terraform core. It is
// mean to be used for additional data a resource may want to pass through.
// The value here must only contain Go primitives and collections.
Meta map[string]interface{}
}
func (d *InstanceDiff) Lock() { d.mu.Lock() }

View File

@ -31,6 +31,10 @@ func TestReadWritePlan(t *testing.T) {
RequiresNew: true,
},
},
Meta: map[string]interface{}{
"foo": []interface{}{1, 2, 3},
},
},
},
},