hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.6k stars 4.64k forks source link

azurerm_network_watcher_flow_log tags aren't updated #27385

Closed neonwhiskers closed 2 weeks ago

neonwhiskers commented 1 month ago

Is there an existing issue for this?

Community Note

Terraform Version

1.9.0

AzureRM Provider Version

4.0.1

Affected Resource(s)/Data Source(s)

azurerm_network_watcher_flow_log

Terraform Configuration Files

resource "azurerm_network_watcher_flow_log" "this" {
  ...
  tags = {
    "cdt-service-level-class" = "missing"
  }
}

Debug Output/Panic Output

# module.resource_group.module.network_spoke[0].azurerm_network_watcher_flow_log.this will be updated in-place
  ~ resource "azurerm_network_watcher_flow_log" "this" {
        id                        = "/subscriptions/f0...-...-...-...-.../resourceGroups/NetworkWatcherRG/providers/Microsoft.Network/networkWatchers/NetworkWatcher_westeurope/flowLogs/nsg-prod"
        name                      = "nsg-prod"
      ~ tags                      = {
          ...
          ~ "cdt-service-level-class" = "undef" -> "missing"
        }
        # (7 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

Expected Behaviour

When applying a Terraform plan to update the azurerm_network_watcher_flow_log resource, any changes to the tags block (such as modifying the value of an existing tag) should be applied in-place.

Actual Behaviour

The current behavior is that tag updates are not being applied during in-place updates, even though Terraform detects the changes and lists them in the plan.

Steps to Reproduce

  1. create a configuration based on this example
  2. add tags to the just created resource
  3. terraform apply
  4. change tag value
  5. terraform apply
  6. terraform plan again to see that this change is planned again

Important Factoids

No response

References

No response

originalag commented 1 month ago

I ran into this exact issue on the latest version of 3.x (3.116.0) and tested several versions of azurerm to pinpoint when it was introduced, which I found to be 3.103.0:

3.116.0: Broken 3.103.0: Broken 3.102.0: Works