Skip to content

Commit

Permalink
Merge pull request hashicorp#11577 from hashicorp/f-diff-meta
Browse files Browse the repository at this point in the history
terraform: add Meta field to diffs
  • Loading branch information
mitchellh authored Jan 31, 2017
2 parents 039701f + 068b2b2 commit c503caa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions terraform/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() }
Expand Down
4 changes: 4 additions & 0 deletions terraform/plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ func TestReadWritePlan(t *testing.T) {
RequiresNew: true,
},
},

Meta: map[string]interface{}{
"foo": []interface{}{1, 2, 3},
},
},
},
},
Expand Down

0 comments on commit c503caa

Please sign in to comment.