Open andyburridge opened 2 weeks ago
Hi @andyburridge ,
Thank you for bringing this issue to our attention. It seems that the order of creation might have changed after Terraform deployed the configuration to the FGT. Could you kindly add dynamic_sort_subtable = true to your resources and recreate the objects? This should help organize your blocks before sending the configuration to the FGT. If the issue continues, would you mind sharing your Terraform FOS version and FGT version? The issue may be related to a version difference.
Thanks, Maxx
Thanks @MaxxLiu22, appreciate the quick response and I'll try this soon.
Would I need to delete the resources and then recreate them for this to take effect or can I simply add this parameter into the existing resource? Or will adding the parameter actually force recreation?
The reason I ask is that these resources are already in use in policies on a production device.
If I need to delete and recreate all of these resources then this will take longer to test.
Hi @andyburridge ,
Ideally, you could delete the resource and recreate it, as the element order should be fixed on FGT once you first apply your configuration. However, you might also want to try adding dynamic_sort_subtable = true
and then applying it. This typically shouldn't force a recreation, but you can double-check during the plan stage, as it will notify you if recreation is required. May I ask which versions of FOS and the Terraform FOS provider you're using? I wasn't able to reproduce the issue on my side, even without setting dynamic_sort_subtable
, using Terraform FOS 1.21.0 and FOS 7.4.5.
Thanks, Maxx
Hi @MaxxLiu22
Adding dynamic_sort_subtable = true
to my existing resources fixed the issue on ~60 resources, but bizarrely not 3 which still exhibit the same behaviour.
I've checked and I'm using FOS 7.2.7 and Provider 1.16.0, so a pretty old version of the provider.
I will try upgrading my provider to the latest version, and if I still have the issue following this then it is not too much of a hardship to delete and recreate the remaining 3 troublesome resources.
Thanks for your assistance.
Hi,
I'm using the following 2 resources:
In combination with a for_each loop in the resource allocation similar to the following :
And variables defined as follows:
Every time the Terraform plan runs, it proposes to make a change to the object groups in the form of replacing the order of the members in the group. Once we apply the plan changes with Terraform apply, it actually completes fine and makes no change to the running code on the firewall, but false alterations showing as ready to be actioned changes in the plan complicates the CICD process.
Is this an issue, or is there something functionally incorrect with the way I'm using the resources?