Skip to content

SDX VPX provisioning resource returning error if the resource in the state file is missing rather than re-deploying it #10

@ksashokumar

Description

@ksashokumar

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:

  1. Provision a VM in the SDX using SDX provider.
  2. Delete the VM directly in the SDX GUI.
  3. Now re-run the terraform apply command.
  4. Typically, the resource should re deploy the VM as per in the state file but it is throwing the error, "Resource does not exists".
  5. The resource code returns the error when the resource doesn't exists rather than setting it to NULL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions