-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecation of ignore_body_changes #583
Comments
Hi @nyanhp , Thank you for taking time to report this issue! Please first switch to use the dynamic attribute in
Would you please share more details about the scenario? Thanks! |
Hello, I can add a situation in the lifecycle parameter does not work. If I try to implement a virtual network with subnets where the lifecycle of the subnets I want to ignore, I get the following error: resource "azapi_resource" "vnet" {
type = "Microsoft.Network/virtualNetworks@2024-01-01"
name = "test"
parent_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test"
location = "Spain Central"
body = {
properties = {
addressSpace = {
addressPrefixes = ["10.0.0.0/16"]
}
dhcpOptions = {
dnsServers = ["8.8.8.8", "1.1.1.1"]
}
subnets = [
{
name = "subnet1"
properties = {
addressPrefixes = ["10.0.1.0/24"]
}
},
{
name = "subnet2"
properties = {
addressPrefixes = ["10.0.2.0/24"]
}
}
]
}
}
lifecycle {
ignore_changes = [body.properties.subnets]
}
}
|
Hi @gareda , Thanks for the details! Behind the scene, the |
@ms-henglu I understand that I can do a bypass by disabling schema validation, but shouldn't the correct ones be that it is not necessary? Another example where ignore_body_changes is more interesting than lifecycle is that the former can be dynamic, you can set conditionals using a : x ? y or other systems like for, lifecycle does not allow this at the moment, the values have to be static. |
Concur with @gareda on the last statement. As we publish modules that are reusable, the ability to dynamically define fields that are ignored is a nice workaround to the lack of support for dynamic configurations in a lifecycle block. Is there any appetite to have support for both types? |
Hi!
According to the documentation
terraform-provider-azapi/docs/resources/resource.md
Line 91 in d588fce
ignore_body_changes
is deprecated, but what are we supposed to use instead?lifecycle
can be used for some, but not all attributes.The text was updated successfully, but these errors were encountered: