CiscoDevNet / terraform-provider-fmc

Terraform Provider for FMC
https://registry.terraform.io/providers/CiscoDevNet/fmc/latest/docs
Mozilla Public License 2.0
16 stars 30 forks source link

Error when adding IP address to interface #139

Closed tiagosil-cisco closed 10 months ago

tiagosil-cisco commented 11 months ago

I'm now deploying a sub-interface on FMC using the following resource but, although it's created, I get the error below. Tried changing the net mask to 24, "24", tostring(24) and tonumber(24), same error.

`resource "fmc_device_subinterfaces" "side_xe" { depends_on = [fmc_security_zone.security_zones] count = local.json_input.sessions name = "${local.json_input.interface_type_ftd}${local.json_input.interface_id_ftd_xe}" device_id = data.fmc_devices.device.id subinterface_id = "${count.index + local.json_input.index_start}" vlan_id = "${count.index + local.json_input.index_start}" security_zone_id = fmc_security_zone.security_zones[count.index].id ifname = "${local.json_input.VRF_PREFIX}${count.index + local.json_input.index_start}-INSIDE" mtu = 1500 enabled = true mode = "NONE" ipv4_static_address = cidrhost(cidrsubnet(local.json_input.supernet_iosxe_fw, 8, count.index + local.json_input.index_start), 2) ipv4_static_netmask = tonumber(24)

}

│ Error: unable to update physical interface │ │ with module.fmc.fmc_device_subinterfaces.side_xe[1], │ on modules/fmc/320_fmc_subinterfaces.tf line 2, in resource "fmc_device_subinterfaces" "side_xe": │ 2: resource "fmc_device_subinterfaces" "side_xe" { │ │ creating sub interfaces: https://10.0.10.36/api/fmc_config/v1/domain/e276abec-e0f2-11e3-8169-6d9ed49b625f/devices/devicerecords/a40968f2-53f9-11ee-a510-d4df6ac80d4e/subinterfaces - json: cannot unmarshal string into Go │ struct field IPv4Static.ipv4.static.netmask of type int ╵ ╷ │ Error: unable to update physical interface │ │ with module.fmc.fmc_device_subinterfaces.side_xe[0], │ on modules/fmc/320_fmc_subinterfaces.tf line 2, in resource "fmc_device_subinterfaces" "side_xe": │ 2: resource "fmc_device_subinterfaces" "side_xe" { │ │ creating sub interfaces: https://10.0.10.36/api/fmc_config/v1/domain/e276abec-e0f2-11e3-8169-6d9ed49b625f/devices/devicerecords/a40968f2-53f9-11ee-a510-d4df6ac80d4e/subinterfaces - json: cannot unmarshal string into Go │ struct field IPv4Static.ipv4.static.netmask of type int `

tiagosil-cisco commented 11 months ago

May be linked with this issue:

https://codesahara.com/blog/golang-cannot-unmarshal-string-into-go-value-of-type-int/

snetlamu commented 10 months ago

Hi @tiagosil-cisco , thank you for raising the issue. We've identified what's causing this behaviour and will be merging a fix soon. ETA is Nov 7 or earlier.

snetlamu commented 10 months ago

This issue has been fixed in release 1.4.6