diff --git a/terraform/diff.go b/terraform/diff.go index c50d3cedb3..d50ec5b10a 100644 --- a/terraform/diff.go +++ b/terraform/diff.go @@ -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() } diff --git a/terraform/plan_test.go b/terraform/plan_test.go index 02331558a9..9515efbaaa 100644 --- a/terraform/plan_test.go +++ b/terraform/plan_test.go @@ -31,6 +31,10 @@ func TestReadWritePlan(t *testing.T) { RequiresNew: true, }, }, + + Meta: map[string]interface{}{ + "foo": []interface{}{1, 2, 3}, + }, }, }, },