diff --git a/terraform/diff.go b/terraform/diff.go index 488b63b68..5a04f4043 100644 --- a/terraform/diff.go +++ b/terraform/diff.go @@ -615,7 +615,7 @@ func (d *InstanceDiff) Same(d2 *InstanceDiff) (bool, string) { // that value is allowed since it may mean the value ended up // being the same. if diffOld.NewComputed { - continue + ok = true } // No exact match, but maybe this is a set containing computed diff --git a/terraform/diff_test.go b/terraform/diff_test.go index 9f7816f63..fca0fbcbe 100644 --- a/terraform/diff_test.go +++ b/terraform/diff_test.go @@ -608,6 +608,34 @@ func TestInstanceDiffSame(t *testing.T) { "", }, + // NewComputed on set, removed + { + &InstanceDiff{ + Attributes: map[string]*ResourceAttrDiff{ + "foo.#": &ResourceAttrDiff{ + Old: "", + New: "", + NewComputed: true, + }, + }, + }, + &InstanceDiff{ + Attributes: map[string]*ResourceAttrDiff{ + "foo.1": &ResourceAttrDiff{ + Old: "foo", + New: "", + NewRemoved: true, + }, + "foo.2": &ResourceAttrDiff{ + Old: "", + New: "bar", + }, + }, + }, + true, + "", + }, + { &InstanceDiff{ Attributes: map[string]*ResourceAttrDiff{