From d24ab685d0865b27311c0ab7b9e545b188bfd425 Mon Sep 17 00:00:00 2001 From: Sander van Harmelen Date: Tue, 16 Dec 2014 13:58:31 +0100 Subject: [PATCH] Adding a small fix to the Same() func This is a little tricky, but when a diff contains a computed list or set that can only be interpolated after the apply command has created the dependant resources, it could turn out that the result is actually the same as the existing state which would remove the key from the diff --- terraform/diff.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/terraform/diff.go b/terraform/diff.go index 7a2734c32..f9a0e1887 100644 --- a/terraform/diff.go +++ b/terraform/diff.go @@ -438,6 +438,15 @@ func (d *InstanceDiff) Same(d2 *InstanceDiff) bool { } } + // This is a little tricky, but when a diff contains a computed list + // or set that can only be interpolated after the apply command has + // created the dependant resources, it could turn out that the result + // is actually the same as the existing state which would remove the + // key from the diff. + if diffOld.NewComputed && strings.HasSuffix(k, ".#") { + ok = true + } + if !ok { return false }