From 7137d855226256e2e5bb7572c4435676e294897e Mon Sep 17 00:00:00 2001 From: James Bardin Date: Mon, 21 May 2018 19:14:40 -0400 Subject: [PATCH] ignore id when creating diffs The id field is always computed, and never directly related to a diff. Since that field is being converted to a regular schema attribute, we need to handle the behavior in the mocks too. --- terraform/context_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/terraform/context_test.go b/terraform/context_test.go index 54994d851..ba4dfdab6 100644 --- a/terraform/context_test.go +++ b/terraform/context_test.go @@ -265,6 +265,12 @@ func testDiffFn( } for k, attrDiff := range testFlatAttrDiffs(k, v) { + // we need to ignore 'id' for now, since it's always inferred to be + // computed. + if k == "id" { + continue + } + if k == "require_new" { attrDiff.RequiresNew = true } @@ -281,6 +287,9 @@ func testDiffFn( } for _, k := range c.ComputedKeys { + if k == "id" { + continue + } diff.Attributes[k] = &ResourceAttrDiff{ Old: "", NewComputed: true,