diff --git a/helper/plugin/grpc_provider.go b/helper/plugin/grpc_provider.go index be3d2f9898..b880661bda 100644 --- a/helper/plugin/grpc_provider.go +++ b/helper/plugin/grpc_provider.go @@ -498,6 +498,12 @@ func (s *GRPCProviderServer) PlanResourceChange(_ context.Context, req *proto.Pl return resp, nil } + // We don't usually plan destroys, but this can return early in any case. + if proposedNewStateVal.IsNull() { + resp.PlannedState = req.ProposedNewState + return resp, nil + } + info := &terraform.InstanceInfo{ Type: req.TypeName, } diff --git a/terraform/diff.go b/terraform/diff.go index f87db081fc..e68f3d81ef 100644 --- a/terraform/diff.go +++ b/terraform/diff.go @@ -546,7 +546,7 @@ func (d *InstanceDiff) applyBlockDiff(path []string, attrs map[string]string, sc } // check for empty "count" keys - if strings.HasSuffix(attr, ".#") && diff.New == "0" { + if (strings.HasSuffix(attr, ".#") || strings.HasSuffix(attr, ".%")) && diff.New == "0" { continue }