If a resource deployed using SDX VPX provisioning resource gets deleted in the SDX, the provider is not creating the resource again when we do terraform apply. It responds with the following error.
Plan: 0 to add, 1 to change, 0 to destroy.
╷
│ Error: failed: 404 Not Found ({ "errorcode": 10011, "message": "Resource does not exist", "severity": "ERROR" })
│
│ with module.dut_provision_sdx2.citrixsdx_provision_vpx.dut,
│ on ../modules/dut_sdx/main.tf line 1, in resource "citrixsdx_provision_vpx" "dut":
│ 1: resource "citrixsdx_provision_vpx" "dut" {
│
╵
Steps to reproduce:
- Provision a VM in the SDX using SDX provider.
- Delete the VM directly in the SDX GUI.
- Now re-run the terraform apply command.
- Typically, the resource should re deploy the VM as per in the state file but it is throwing the error, "Resource does not exists".
- The resource code returns the error when the resource doesn't exists rather than setting it to NULL.