Previously, when using terraformless export (i.e. -tfclient-plugin-path), if the resource/resource group to be exported doesn't exit, an empty HCL block will still be generated.
This PR adds additional check after the ReadResource RPC call, to raise error if the state read is nil. This logic exists in terraform (@internal/terraform/node_resource_import.go), that's why terraform export will correctly raise the error for non-existent resources.
Previously, when using terraformless export (i.e.
-tfclient-plugin-path
), if the resource/resource group to be exported doesn't exit, an empty HCL block will still be generated.This PR adds additional check after the ReadResource RPC call, to raise error if the state read is nil. This logic exists in
terraform
(@internal/terraform/node_resource_import.go), that's why terraform export will correctly raise the error for non-existent resources.