From 9179cdcbc6494bfe03a5b18cff0804961d722f66 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 26 Sep 2018 09:20:32 -0700 Subject: [PATCH] plans/planfile: allow resource instances with no instance key This happens for resources that don't have either "count" or "for_each" set. --- plans/planfile/tfplan.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plans/planfile/tfplan.go b/plans/planfile/tfplan.go index 7f5499f86..0474f97e3 100644 --- a/plans/planfile/tfplan.go +++ b/plans/planfile/tfplan.go @@ -172,6 +172,7 @@ func resourceChangeFromTfplan(rawChange *planproto.ResourceInstanceChange) (*pla var instKey addrs.InstanceKey switch rawTk := rawChange.InstanceKey.(type) { + case nil: case *planproto.ResourceInstanceChange_Int: instKey = addrs.IntKey(rawTk.Int) case *planproto.ResourceInstanceChange_Str: @@ -382,6 +383,8 @@ func resourceChangeToTfplan(change *plans.ResourceInstanceChangeSrc) (*planproto ret.Name = relAddr.Resource.Name switch tk := relAddr.Key.(type) { + case nil: + // Nothing to do, then. case addrs.IntKey: ret.InstanceKey = &planproto.ResourceInstanceChange_Int{ Int: int64(tk),