magodo / terraform-provider-restful

Terraform provider to manage RESTful resources
https://registry.terraform.io/providers/magodo/restful
Mozilla Public License 2.0
15 stars 5 forks source link

Cannot migrate from 0.12.0 to 0.16.0 #119

Open seblatre opened 2 months ago

seblatre commented 2 months ago

I'm in the way of upgrading my whole terraform stack but I'm running into the error while bumping from restful 0.12.0 to 0.16.0: (Using terraform 1.9.5)

╷
│ Warning: Failed to decode resource from state
│
│ Error decoding
│ "module.[...].restful_operation.release_folder_permissions"
│ from prior state: missing expected {
╵

╷
│ Error: Value Conversion Error
│
│   with module.[...].restful_operation.release_folder_permissions,
│ An unexpected error was encountered trying to convert from struct into an
│ object. This is always an error in the provider. Please report the
│ following to the provider developer:
│
│ Mismatch between struct and object type: Struct defines fields not found in
│ object: retry_delete and retry. Object defines fields not found in struct:
│ id_builder.
│ Struct: migrate.OperationDataV1
│ Object type: types.ObjectType["body":basetypes.DynamicType,
│ "delete_body":basetypes.DynamicType, "delete_method":basetypes.StringType,
│ "delete_path":basetypes.StringType,
│ "header":types.MapType[basetypes.StringType], "id":basetypes.StringType,
│ "id_builder":basetypes.StringType, "method":basetypes.StringType,
│ "output":basetypes.DynamicType,
│ "output_attrs":types.SetType[basetypes.StringType],
│ "path":basetypes.StringType,
│ "poll":types.ObjectType["default_delay_sec":basetypes.Int64Type,
│ "header":types.MapType[basetypes.StringType],
│ "status":types.ObjectType["pending":types.ListType[basetypes.StringType],
│ "success":basetypes.StringType], "status_locator":basetypes.StringType,
│ "url_locator":basetypes.StringType],
│ "poll_delete":types.ObjectType["default_delay_sec":basetypes.Int64Type,
│ "header":types.MapType[basetypes.StringType],
│ "status":types.ObjectType["pending":types.ListType[basetypes.StringType],
│ "success":basetypes.StringType], "status_locator":basetypes.StringType,
│ "url_locator":basetypes.StringType],
│ "precheck":types.ListType[types.ObjectType["api":types.ObjectType["default_delay_sec":basetypes.Int64Type,
│ "header":types.MapType[basetypes.StringType], "path":basetypes.StringType,
│ "query":types.MapType[types.ListType[basetypes.StringType]],
│ "status":types.ObjectType["pending":types.ListType[basetypes.StringType],
│ "success":basetypes.StringType], "status_locator":basetypes.StringType],
│ "mutex":basetypes.StringType]],
│ "precheck_delete":types.ListType[types.ObjectType["api":types.ObjectType["default_delay_sec":basetypes.Int64Type,
│ "header":types.MapType[basetypes.StringType], "path":basetypes.StringType,
│ "query":types.MapType[types.ListType[basetypes.StringType]],
│ "status":types.ObjectType["pending":types.ListType[basetypes.StringType],
│ "success":basetypes.StringType], "status_locator":basetypes.StringType],
│ "mutex":basetypes.StringType]],
│ "query":types.MapType[types.ListType[basetypes.StringType]]]
╵

Note: I have a hundred of states to migrate

magodo commented 2 months ago

@seblatre We don't support auto migrating from v0.12.0 unfortunately, there were several breaking changes during the updates. For those errored ones, I suggest you can manually import them.