terraform-provider-fortios icon indicating copy to clipboard operation
terraform-provider-fortios copied to clipboard

Firewall Policy - PolicyID keeps forcing replacement

Open aarjbdea opened this issue 3 years ago • 5 comments

When configuring a new firewall policy with policyid not set it will attempt to set the policyid to null on each terraform apply run and then will force a replacement of the firewall policy. From previous issues this shouldnt happen (https://github.com/fortinetdev/terraform-provider-fortios/issues/160) as the policyid is stored within the terraform state file. Any ideas?

This is one of the lines that appears in the terraform plan

  • policyid = 11 -> null # forces replacement

aarjbdea avatar Aug 30 '22 14:08 aarjbdea

We are having this issue too - every apply job all policies get recreated

gmintoco avatar Sep 01 '22 02:09 gmintoco

Ive done some testing today and it would appear that v1.15.0 has broken this - v1.14.1 is working correctly and is not recreating the firewall policies

aarjbdea avatar Sep 01 '22 09:09 aarjbdea

Hi, @aarjbdea @gmintoco
Apply this config on the firewall policy resource:

lifecycle {
    ignore_changes = [policyid]
  }

It work for me.

pedrojgsbraga avatar Sep 01 '22 10:09 pedrojgsbraga

Hi @aarjbdea,

Thank you for raising this issue. Team are working on this issue. We will fix it in the next release.

Thanks, Xing

lix-fortinet avatar Sep 01 '22 22:09 lix-fortinet

Hi @aarjbdea,

This issue has been fixed in the latest release of FortiOS Terraform provider v1.16.0. Please switch to the latest version of FortiOS Terraform provider and try it again.

Please let me know if you have any questions.

Thanks, Xing

lix-fortinet avatar Oct 10 '22 18:10 lix-fortinet