terraform-azurerm-lz-vending icon indicating copy to clipboard operation
terraform-azurerm-lz-vending copied to clipboard

bug: virtual_network_enabled = false

Open Romiko opened this issue 9 months ago • 2 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Versions

Please paste the output of terraform version command from within the initialized directory:

Terraform v1.5.6
on linux_arm64

Please enter the module version that you are using:

module "lz_vending_
  source  = "Azure/
  version = "4.1.0"

Description

When I have virtual_network_enabled = false and have a vnets section initalised in tfvars, it still cause terraform add/remove

The expected behaviour is to ignore

Resource groups work as expected.

Steps to Reproduce

  1. Define tfvars with vnets
  2. virtual_network_enabled = false
  3. Terraform plan will still want to do the following:

` -/+ destroy and then create replacement

Terraform will perform the following actions:

module.lz_vending_subscriptions["sandbox"].azapi_resource.telemetry_root[0] must be replaced

-/+ resource "azapi_resource" "telemetry_root" { ~ id = "/subscriptions/blahblahblah/providers/Microsoft.Resources/deployments/pid-50a8a460-d517-4b11-b86c-6de447806b67_4.1.0_00000007" -> (known after apply) ~ name = "pid-50a8a460-d517-4b11-b86c-6de447806b67_4.1.0_00000007" -> "pid-50a8a460-d517-4b11-b86c-6de447806b67_4.1.0_00000807" # forces replacement ~ output = jsonencode({}) -> (known after apply) # (8 unchanged attributes hidden) } `

Romiko avatar May 07 '24 23:05 Romiko

Workaround:

virtual_network_enabled = each.value.virtual_network_enabled virtual_networks = each.value.virtual_network_enabled ? each.value.vnets : {}

Romiko avatar May 07 '24 23:05 Romiko

Hi this is a bug in the telemetry logic, thanks for reporting.

matt-FFFFFF avatar Jun 05 '24 15:06 matt-FFFFFF