@@ -65,14 +65,23 @@ type MoveResourceStateRequest struct {
6565 // TargetTypeName is the type name of the target resource as given by
6666 // Terraform across the protocol.
6767 TargetTypeName string
68+
69+ // SourceIdentity is the identity of the source resource.
70+ //
71+ // Only the underlying JSON field is populated.
72+ SourceIdentity * tfprotov6.RawState
73+
74+ // SourceIdentitySchemaVersion is the version of the source resource state.
75+ SourceIdentitySchemaVersion int64
6876}
6977
7078// MoveResourceStateResponse is the framework server response for the
7179// MoveResourceState RPC.
7280type MoveResourceStateResponse struct {
73- Diagnostics diag.Diagnostics
74- TargetPrivate * privatestate.Data
75- TargetState * tfsdk.State
81+ Diagnostics diag.Diagnostics
82+ TargetPrivate * privatestate.Data
83+ TargetState * tfsdk.State
84+ TargetIdentity * tfsdk.ResourceIdentity
7685}
7786
7887// MoveResourceState implements the framework server MoveResourceState RPC.
@@ -125,18 +134,25 @@ func (s *Server) MoveResourceState(ctx context.Context, req *MoveResourceStateRe
125134
126135 for _ , resourceStateMover := range resourceStateMovers {
127136 moveStateReq := resource.MoveStateRequest {
128- SourcePrivate : sourcePrivate ,
129- SourceProviderAddress : req .SourceProviderAddress ,
130- SourceRawState : req .SourceRawState ,
131- SourceSchemaVersion : req .SourceSchemaVersion ,
132- SourceTypeName : req .SourceTypeName ,
137+ SourcePrivate : sourcePrivate ,
138+ SourceProviderAddress : req .SourceProviderAddress ,
139+ SourceRawState : req .SourceRawState ,
140+ SourceSchemaVersion : req .SourceSchemaVersion ,
141+ SourceTypeName : req .SourceTypeName ,
142+ SourceIdentity : req .SourceIdentity ,
143+ SourceIdentitySchemaVersion : req .SourceIdentitySchemaVersion ,
133144 }
134145 moveStateResp := resource.MoveStateResponse {
135146 TargetPrivate : privatestate .EmptyProviderData (ctx ),
136147 TargetState : tfsdk.State {
137148 Schema : req .TargetResourceSchema ,
138149 Raw : tftypes .NewValue (req .TargetResourceSchema .Type ().TerraformType (ctx ), nil ),
139150 },
151+ // TODO: See if we need to change this to identity
152+ TargetIdentity : & tfsdk.ResourceIdentity {
153+ Raw : tftypes .NewValue (req .TargetResourceSchema .Type ().TerraformType (ctx ), nil ),
154+ Schema : req .TargetResourceSchema ,
155+ },
140156 }
141157
142158 if resourceStateMover .SourceSchema != nil {
@@ -237,6 +253,8 @@ func (s *Server) MoveResourceState(ctx context.Context, req *MoveResourceStateRe
237253 "Source Provider Address: " + req .SourceProviderAddress + "\n " +
238254 "Source Resource Type: " + req .SourceTypeName + "\n " +
239255 "Source Resource Schema Version: " + strconv .FormatInt (req .SourceSchemaVersion , 10 )+ "\n " +
240- "Target Resource Type: " + req .TargetTypeName ,
256+ "Target Resource Type: " + req .TargetTypeName , //+"\n"+
257+ // "Source Identity Schema Version: "+strconv.FormatInt(req.SourceSchemaVersion, 10),
258+
241259 )
242260}
0 commit comments