Open NordbergDK opened 4 months ago
Hi @NordbergDK ,
Thank you for taking time to report this issue!
Yes, the ignore_body_changes
is a provider feature which is used to simulate the native lifecycle.ignore_changes feature. And the limitation is that it only works after the resource is imported and the ignore_body_changes
is applied.
We recently released v1.13.1 which supports dynamic properties, and it enables the native lifecycle.ignore_changes feature. And it could suppress the changes before the resource is imported.
More details: https://techcommunity.microsoft.com/t5/azure-tools-blog/announcing-azapi-dynamic-properties/ba-p/4121855
ignore_body_changes
is not working for resources that are imported. None of the properties put intoignore_body_changes
is ignored.Terraform v1.7.3
on windows_amd64
So as you can see terraform wants to delete all the subnets, even if the property is not provided, and it is listed in
ignore_body_changes
. If I apply, the subnet that exists is in fact deleted. Once the import has run, I can manually add the subnet again in the portal, and terraform will ignore the change. So this only applies to resources at the time they are imported. Let me know if you require any more evidence. I have the setup to perform all the tests you like.