fortinetdev / terraform-provider-fortimanager

Mozilla Public License 2.0
11 stars 10 forks source link

fortimanager_object_firewall_address - creation fails for certain ips #51

Closed StizLor closed 5 months ago

StizLor commented 6 months ago

Synopsis

When creating address (v4) objects, certain ip - netmask combinations create an error.

Environment

Used Config (not working)

resource "fortimanager_object_firewall_address" "trname" {
name = "trname"
    obj_type = "ip"
    type = "ipmask"
    subnet = [ "172.27.26.128", "255.255.255.255" ]
    comment     = "synced by git"
}

Used Config (working)

changed IP from 172.27.26.128 to 172.27.26.127


resource "fortimanager_object_firewall_address" "trname" {
name = "trname"
    obj_type = "ip"
    type = "ipmask"
    subnet = [ "172.27.26.127", "255.255.255.255" ]
    comment     = "synced by git"
}

Debug-Logs

The complete Debug Logs generated by Terraform: tf-fmg-working-working.txt tf-fmg-not-working.txt

Observation

In the Log (not working)

2024-04-23T13:14:17.368+0200 [INFO] provider.terraform-provider-fortimanager_v1.11.0: 2024/04/23 13:14:17 [INFO] Request infomation: /pm/config/adom/root/obj/firewall/address: &map[comment:synced by git name:trname obj-type:ip subnet:[255.255.255.255 172.27.26.128] type:ipmask]: timestamp="2024-04-23T13:14:17.368+0200"

This part of the map is shown: subnet:[255.255.255.255 172.27.26.128]

When comparing with the working version

2024-04-23T13:15:54.319+0200 [INFO] provider.terraform-provider-fortimanager_v1.11.0: 2024/04/23 13:15:54 [INFO] Request infomation: /pm/config/adom/root/obj/firewall/address: &map[comment:synced by git name:trname obj-type:ip subnet:[172.27.26.127 255.255.255.255] type:ipmask]: timestamp="2024-04-23T13:15:54.319+0200"

here the map part: subnet:[172.27.26.127 255.255.255.255]

Other

I am not sure if the info I observed regarding the order of the ip and netmask is the right hunch I have. If you find any other issues with my config or need more input just let me know.

MaxxLiu22 commented 6 months ago

Hi @StizLor ,

Thank you for bringing up this issue, and I apologize for any inconvenience it may have caused. This problem may have arisen from addressing another issue (#47) where Terraform attempted to sort the list. I have reported it to the development team for resolution

Thanks, Maxx

kostas-rf commented 5 months ago

We are facing exactly the same issue. About half our subnet address objects don't work because of this ordering problem.

@MaxxLiu22 i saw your last comment on #47, do we know if the new version you mentioned also fixes this issue? If that's the case what is the current ETA?

Many thanks!

MaxxLiu22 commented 5 months ago

Hi @kostas-rf ,

Sorry for the inconvenience. We plan to release the new version today, which has fixed this issue, and it will be available on Terraform within this week.

Thanks, Maxx

StizLor commented 5 months ago

Hi @MaxxLiu22, I just tested the latest release and everything seems to be working as expected now.

Thanks, Stiz