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.59k stars 4.62k forks source link

The documentation for kusto_cluster is missing documentation for enabling / disabling virtual_network_configuration #27660

Open cosh opened 4 days ago

cosh commented 4 days ago

Is there an existing issue for this?

Community Note

Terraform Version

1.9.7

AzureRM Provider Version

4.5.0

Affected Resource(s)/Data Source(s)

azurerm_kusto_cluster

Terraform Configuration Files

resource "azurerm_resource_group" "example" {
  name     = "my-kusto-cluster-rg"
  location = "West Europe"
}

resource "azurerm_kusto_cluster" "example" {
  name                = "kustocluster"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  sku {
    name     = "Standard_D13_v2"
    capacity = 2
  }

  tags = {
    Environment = "Production"
  }

  virtual_network_configuration = {
    State = "Disabled"
  }
}

Debug Output/Panic Output

The doc for 

virtual_network_configuration = {
    State = "Disabled"
  }

is missing

Expected Behaviour

The documentation must be updated with all the config parameters

Actual Behaviour

No response

Steps to Reproduce

No response

Important Factoids

No response

References

No response

liuwuliuyun commented 3 days ago

Hi @cosh, thank you for bringing up this concern. Within the virtual_network_configuration section, it's not possible for users to adjust the State, which is why it's omitted from the documentation. As outlined, if a virtual_network_configuration block is removed from an existing kusto cluster, the State automatically changes to Disabled instead of creating a new resource. This approach is designed to prevent unexpected data loss when a virtual_network_configuration block is deleted.

Some reference code: https://github.com/hashicorp/terraform-provider-azurerm/blob/33649cb3b77e4dd6fed0a43b531ca2d3445f6c2b/internal/services/kusto/kusto_cluster_resource.go#L534-L544 https://github.com/hashicorp/terraform-provider-azurerm/blob/33649cb3b77e4dd6fed0a43b531ca2d3445f6c2b/internal/services/kusto/kusto_cluster_resource.go#L745-L752