Using lifecycle ignore_chages trying to ignore diagnotics settings in keyvault resource

Hi All,

  1. Created random resource group and random keyvault using terraform code
  2. Manually added Diagnotics setting in random keyvault
  3. Added life cycle ignore_changes in terraform code
    But code is throwing an error.

ERROR Message:

D:\terraform1\test> .\terraform.exe plan

Error: Unsupported attribute

  on main.tf line 118, in resource "azurerm_key_vault" "keyvault":
 118:   eventhub_name,

This object has no argument, nested block, or exported attribute named
"eventhub_name".


Error: Unsupported attribute

  on main.tf line 119, in resource "azurerm_key_vault" "keyvault":
 119:   eventHubAuthorizationRuleId

This object has no argument, nested block, or exported attribute named
"eventHubAuthorizationRuleId".
resource "azurerm_key_vault" "keyvault" {

name = "ragetest"
location            = var.location
resource_group_name = azurerm_resource_group.resource_group.name
enabled_for_disk_encryption = false
purge_protection_enabled = false
sku_name = "standard"
tenant_id = data.azurerm_client_config.current.tenant_id


lifecycle {
ignore_changes = [
  eventhub_name,
  eventHubAuthorizationRuleId
  ]
  }
access_policy {
    tenant_id = data.azurerm_client_config.current.tenant_id
    object_id = data.azurerm_client_config.current.object_id

    key_permissions = [
      "Get",
    ]

    secret_permissions = [
      "Get",
    ]

    storage_permissions = [
      "Get",
    ]
  }
}

Only guess here but perhaps eventhub_name is not accurate or you have it in the wrong resource as a lifecycle option. An idea would be to run a destroy or change the value and run a plan and see what it will change and under which resource