I am not sure I can think of an elegant solution to this, other than a procedural one which would involve two runs. This Blue/Green approach is actually how we manage our internal infra.
You first add the new resource to your config, updating any references but leaving the resource which is going to be replaced in the config and run Terraform apply
You can then test that the new setup works and is running correctly
If all is OK, then you remove the old resource from your configuration and again run Terraform apply
Yeah, I eventually did more or less that (I used -target to exclude destruction of resource B during first run), but I am interested in a more automated way. Actual production deployment will be conducted by my client for whom I want to make the process as easy as possible.
Thanks for your reply anyway.