Migrate core logic to terraform-plugin-sdk/v2
xescugc opened this issue · 1 comments
Abstract
The core logic to import is based on the internal code of Terraform before the TF-SDK came out. Now with the TF-SDK beeing more evolved I think we'll be able to use it to move more logic outside of Terracognita into the TF-SDK.
Proposal
Migrate the core logic to TF-SDKv2 so we are not stuck
Implementation
The main idea would be to kind of fake a server initialization using directly the Plugins. Normally how TF works is a GRPC communication between TF and the Providers, if what I'm saying is correct we should be able to initialize in code the TFProvider server and call it manually inside code without GRPC directly.
This is more or less what we are doing now but manually without any TF code in between, but with this change we would need to maintain less code as it'll be maintained by the TF-SDK directly.
All this said this is still a theory but we need to migrate to it somehow because we cannot use TF-SDKv2 internally as they have changed the imports path on the Providers to not use TF anymore but TF-SDKv2 and other changes, so we would be blocked.
Open issues (if applicable)
Right now this is blocked by hashicorp/terraform-provider-azurerm#10022