Skip to main content
New Member
June 11, 2026
Question

FortiManager error installing packages with terraform

  • June 11, 2026
  • 1 reply
  • 58 views

I am currently trying to see the limits of Terraform in deploying configuration in Fortimanager and Fortigates. My goal is to beable to implement a webfilter on policies and install those policies and the package (FortiManager) related on the required target (Fortigate).

Everything was working correctly until I added the webfilter profile. Terraform execution is working correctly. But in Fortimanager the taskfor installing the package results every time in "Error".

I tried to push it using manually using the gui with the web filter profile created by terraform. There is no erro. I also tried to implement this partin Ansible and the problem is exactly the same.

The module for implementing the firewall policies :

resource "fortimanager_packages_firewall_policy" "tunnelInternet" {
  for_each = var.InternetPolicies
  scopetype = "adom"
  adom      = local.get_adom_from_pkg_internet[each.key]
  pkg       = each.value.pkg
  name      = each.value.name
  policyid  = each.value.policy_id
  srcintf   = each.value.srcintf
  dstintf   = each.value.dstintf
  srcaddr   = each.value.srcaddr
  dstaddr   = each.value.dstaddr
  service   = each.value.service
  action    = each.value.action
  status    = each.value.status
  nat = each.value.nat
  webfilter_profile = "wb-categories-${local.pkg_to_scope_member[each.value.pkg]}"
  fixedport = "disable"
  permit_stun_host = "disable"
  auto_asic_offload    = "disable" # ou "disable"
  schedule  = "always"
  logtraffic = "all"
  comments  = "Test policy via Terraform"
  ssl_ssh_profile = "certificate-inspection"
  
  lifecycle {
    create_before_destroy = true
  }
  depends_on = [fortimanager_dvmdb_adom.test,  fortimanager_object_webfilter_profile.webfilter, time_sleep.wait_30_seconds]
}

The module for installing the packages :

resource "fortimanager_securityconsole_install_package" "install_package" {
  for_each = var.packages
  fmgadom           = var.fortigates_provider[each.value.scope_member_name].adom
  flags             = ["none"]
  pkg               = each.value.package_name
  force_recreate    = uuid()
   depends_on = [
    fortimanager_packages_firewall_policy.tunnelInternet,
    fortimanager_packages_firewall_policy.tunnelsPolicies,
    time_sleep.wait_30_seconds
  ]
}
The error on the GUI: enter image description here

Can someone help me find a solution?

1 reply

New Member
June 25, 2026

the same question I was asked at https://stackoverflow.com/questions/79666537/fortimanager-error-installing-packages-with-terraformjewellok but they messaged me and asked to remove the question because it already asked,