terraform-plugin-framework icon indicating copy to clipboard operation
terraform-plugin-framework copied to clipboard

Provide user config during import

Open appilon opened this issue 4 years ago • 2 comments
trafficstars

Module version

0.4.2

Use-cases

It would be very useful during import if the request object contained the Config of the resource block attempting to be imported into. I have a resource that only reads certain keys from the API response if they are present in the config.

appilon avatar Oct 29 '21 18:10 appilon

Hey @appilon 👋 Just to drop a quick note -- this will require upstream changes in Terraform CLI, the protocol, and terraform-plugin-go before this it can potentially be implemented. We are overdue to submit a more formal proposal issue on the topic. For additional context see:

https://github.com/hashicorp/terraform-plugin-go/blob/d36cd4c7fc48ae8bc44991b2445b96a242748893/tfprotov6/internal/tfplugin6/tfplugin6.proto#L294-L297

The closest Terraform CLI issue I found was https://github.com/hashicorp/terraform/issues/28536, although that is only a related problem for Terraform-only attributes.

bflad avatar Oct 29 '21 20:10 bflad

Thanks for the update, It's only a UX nuisance for me at this time, I instruct via warning that after import the user needs to run apply again to sync the Map in config (that presently doesn't exist in state).

appilon avatar Oct 29 '21 20:10 appilon