hashicorp / terraform-plugin-framework

A next-generation framework for building Terraform providers.
https://developer.hashicorp.com/terraform/plugin/framework
Mozilla Public License 2.0
304 stars 93 forks source link

Provide user config during import #220

Open appilon opened 3 years ago

appilon commented 3 years ago

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.

bflad commented 3 years ago

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.

appilon commented 3 years ago

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).