Closed huntx closed 3 months ago
I believe this is "expected", as the corresponding DME object cannot be deleted. I don't see how this can be fixed on the provider side.
I think that the desired behavior is to destroy the abandoned resource truly. In the case of a physical interface maybe invoking a "default interface X" command could satisfy the use case.
I guess it depends.. technically the object exists already (with whatever configuration was applied before) and is then updated by Terraform. We cannot issue any CLI commands as we are using the REST NX-API to configure the device and we cannot destroy the interface object due to the API preventing this.
Yes, this is non trivial thing. From application point of view what we are tracking is configuration, and tracked configuration dissapears when the resource is destroyed, or moved from one interface to other. In the latest, even Terraform correctly identifies it and signals the warning about resource is going to be recreated.
As i said this topic is not easy but leaving the configuration on the non-tracked object is a stone on the path. From my point of view it limits why choosing at this use case Terraform over other tools such as Ansible.
Enhancement added in v0.5.3 release. Terraform will now reset port to default settings when destroying the resource.
As per title, when "nxos_physical_interface" resource is destroyed, most of the config lines still remain on device configuration.
For example,
After resource destroyed, the device "show run interface" still look like below.
It is expected to remove the port description and vlan-related configuration, or fall back to default port config.