Terraform Version: 0.15.4
FortiOS Provider Version: 1.11.0
Hi,
I am trying to find a way to member interfaces to a redundant interface on a Fortigate using Terraform.
I am using the “fortios_system_interface” resource and I manage to create the redundant interface itself:
resource "fortios_system_interface" "redundant_internal" {
name = "red_int"
role = "lan"
ip = "0.0.0.0/0.0.0.0"
type = "redundant"
vdom = "root"
status = "up"
description = "Managed with Terraform"
}
When I try to add the “member” attribute, I get an error saying that the resource does not expect that attribute, when it is in fact listed in the documentation. I took a look at the code for the “fortios_system_interface” resource and it seems that “member” is expected to be a list of maps, so I tried to define as a local variable like so:
locals {
member = [
{
interface_name = "port3"
},
{
interface_name = "port4"
},
]
}
Then, I tried adding the “interface” attribute to the resource, with “${local.member}” as its value, but I get an error saying that the “interface” attribute expects a value of type string. So out of frustration I tried defining the “interface” attribute as “port3,port4”, and while this time I got no errors, the Fortigate simply ignored that and no members were added to the redundant interface.
I’m honestly at a loss on how to do this so if someone with experience on this can help it would be greatly appreciated.
Thanks and Regards,
Clifton