CiscoDevNet / terraform-provider-dcnm

Cisco DCNM Provider
https://registry.terraform.io/providers/CiscoDevNet/dcnm/latest/docs
Mozilla Public License 2.0
8 stars 15 forks source link

Setting the `tag` to empty a string `""` configures a tag with value `12345` #115

Open jgomezve opened 1 year ago

jgomezve commented 1 year ago

Community Note

Terraform Version

Affected Resource(s)

Terraform Configuration Files

resource "dcnm_network" "first" {
  fabric_name  = "MyFabrc"
  name         = "MyNetwok"
  network_id   = "1234"
  display_name = "MyNetwok"
  vrf_name     = "MyVRF"
  tag          = ""
  deploy       = false
}

Debug Output

Panic Output

Expected Behavior

Routing Tag in NDFC should not be set to the default value (12345)

Actual Behavior

The value of the Routing Tag field should be empty but it configures the default value image

Steps to Reproduce

  1. terraform apply

Important Factoids

References

dsx1123 commented 1 year ago

@jgomezve the current SDK can't distinguish the difference between the empty string and non-provided parameter, we default the value to 12345 for the route tag as it is the default value provided in the default template. the new framework of terraform provider seems to have a way to distinguish it, but it will be heavy lifting if we change to use it.

jgomezve commented 1 year ago

@dsx1123 is there any way to set the Tag to an empty string "" ?

dsx1123 commented 1 year ago

@jgomezve currently, there is no way, if we change the default value to "", it will break the backward compatibility, this tag is usually used for route filtering, will setting it to a dummy string be a workaround for you?

jgomezve commented 1 year ago

I dont want to have the tag set on the SVI IP address.

interface Vlan2300
  vrf member vrf_tier2_lb_inside
  no ip redirects
  ip address 192.168.0.1/24 tag 12345
  fabric forwarding mode anycast-gateway
  no shutdown

I guess a dummy tag won't cause any problem but still it's something customers want to avoid