FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
mkatary
Staff
Staff
Article Id 203390
Description

This article describes the workaround when deleting addresses included in address groups.

Scope

When trying to delete address objects included in address group object, terraform tries to delete the address object before removing it from address group object which will fail with 'Internal Server Error'.

 

Error: Error deleting FirewallAddress resource: Internal Server Error - Internal error when processing the request (500)

Solution

Set the create_before_destroy flag to true under lifecycle in the resource block.

 

resource "fortios_firewall_address" "tf_addresses" {
lifecycle {
create_before_destroy = true
}
}

 

Run terraform apply to add the flag to the state then try to delete the resource.

 

Related document:

Terraform Provider FortiOS - Github Issues.