send config during apply

This commit is contained in:
James Bardin 2019-01-04 13:47:04 -05:00
parent 3ce68d61a3
commit 6f54bfaa7c
1 changed files with 6 additions and 0 deletions

View File

@ -420,11 +420,17 @@ func (p *GRPCProvider) ApplyResourceChange(r providers.ApplyResourceChangeReques
resp.Diagnostics = resp.Diagnostics.Append(err) resp.Diagnostics = resp.Diagnostics.Append(err)
return resp return resp
} }
configMP, err := msgpack.Marshal(r.Config, resSchema.Block.ImpliedType())
if err != nil {
resp.Diagnostics = resp.Diagnostics.Append(err)
return resp
}
protoReq := &proto.ApplyResourceChange_Request{ protoReq := &proto.ApplyResourceChange_Request{
TypeName: r.TypeName, TypeName: r.TypeName,
PriorState: &proto.DynamicValue{Msgpack: priorMP}, PriorState: &proto.DynamicValue{Msgpack: priorMP},
PlannedState: &proto.DynamicValue{Msgpack: plannedMP}, PlannedState: &proto.DynamicValue{Msgpack: plannedMP},
Config: &proto.DynamicValue{Msgpack: configMP},
PlannedPrivate: r.PlannedPrivate, PlannedPrivate: r.PlannedPrivate,
} }