prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  CKV_AZURE_116 fails with Terraform Azure provider >= v.2.97.0
  **Describe the issue**
  This issue is regarding CKV_AZURE_116.
  Since v2.97.0 of the Azure Terraform provider, the Azure policies add-on is enabled by setting
  
  ```terraform
  azure_policy_enabled = true
  ```
  
  as a top-level property in a `azurerm_kubernetes_cluster` resource definition, instead of the following
  
  ```terraform
  addon_profile {
    azure_policy {
      enabled = true
    }
  }
  ```
  The check should be updated to reflect the change.
  
  **Examples**
  ```terraform
  resource "azurerm_kubernetes_cluster" "example" {
    azure_policy_enabled = true
  }
  ```
  should pass the check for CKV_AZURE_116.
  
  **Version:**
  2.0.1160
  
  **Additional context**
  None
  
  I will submit a PR to fix this.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `checkov/terraform/checks/resource/azure/AKSUsesAzurePoliciesAddon.py`
  Content:
  ```
  1 from checkov.common.models.enums import CheckCategories
  2 from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
  3 
  4 
  5 class AKSUsesAzurePoliciesAddon(BaseResourceValueCheck):
  6     def __init__(self):
  7         name = "Ensure that AKS uses Azure Policies Add-on"
  8         id = "CKV_AZURE_116"
  9         supported_resources = ['azurerm_kubernetes_cluster']
  10         categories = [CheckCategories.NETWORKING]
  11         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
  12 
  13     def get_inspected_key(self):
  14         return "addon_profile/[0]/azure_policy/[0]/enabled"
  15 
  16 
  17 check = AKSUsesAzurePoliciesAddon()
  18
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/checkov/terraform/checks/resource/azure/AKSUsesAzurePoliciesAddon.py b/checkov/terraform/checks/resource/azure/AKSUsesAzurePoliciesAddon.py
  --- a/checkov/terraform/checks/resource/azure/AKSUsesAzurePoliciesAddon.py
  +++ b/checkov/terraform/checks/resource/azure/AKSUsesAzurePoliciesAddon.py
  @@ -1,8 +1,10 @@
  -from checkov.common.models.enums import CheckCategories
  -from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
  +from typing import Dict, List, Any
   
  +from checkov.common.models.enums import CheckCategories, CheckResult
  +from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
   
  -class AKSUsesAzurePoliciesAddon(BaseResourceValueCheck):
  +
  +class AKSUsesAzurePoliciesAddon(BaseResourceCheck):
       def __init__(self):
           name = "Ensure that AKS uses Azure Policies Add-on"
           id = "CKV_AZURE_116"
  @@ -10,8 +12,20 @@
           categories = [CheckCategories.NETWORKING]
           super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
   
  -    def get_inspected_key(self):
  -        return "addon_profile/[0]/azure_policy/[0]/enabled"
  +    def scan_resource_conf(self, conf: Dict[str, List[Any]]) -> CheckResult:
  +        # since Azure provider v2.97.0
  +        azure_policy_enabled = conf.get("azure_policy_enabled", [None])[0]
  +        if azure_policy_enabled:
  +            self.evaluated_keys = ["azure_policy_enabled"]
  +            return CheckResult.PASSED
  +        # up to and including Azure provider v2.96.0
  +        self.evaluated_keys = ["addon_profile/[0]/azure_policy/[0]/enabled"]
  +        addon_profile = conf.get("addon_profile", [None])[0]
  +        if addon_profile and isinstance(addon_profile, dict):
  +            azure_policy = addon_profile.get("azure_policy", [None])[0]
  +            if azure_policy and isinstance(azure_policy, dict) and azure_policy.get("enabled", [None])[0]:
  +                return CheckResult.PASSED
  +        return CheckResult.FAILED
   
   
   check = AKSUsesAzurePoliciesAddon()
  
verification_info: {"golden_diff": "diff --git a/checkov/terraform/checks/resource/azure/AKSUsesAzurePoliciesAddon.py b/checkov/terraform/checks/resource/azure/AKSUsesAzurePoliciesAddon.py\n--- a/checkov/terraform/checks/resource/azure/AKSUsesAzurePoliciesAddon.py\n+++ b/checkov/terraform/checks/resource/azure/AKSUsesAzurePoliciesAddon.py\n@@ -1,8 +1,10 @@\n-from checkov.common.models.enums import CheckCategories\n-from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck\n+from typing import Dict, List, Any\n \n+from checkov.common.models.enums import CheckCategories, CheckResult\n+from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n \n-class AKSUsesAzurePoliciesAddon(BaseResourceValueCheck):\n+\n+class AKSUsesAzurePoliciesAddon(BaseResourceCheck):\n     def __init__(self):\n         name = \"Ensure that AKS uses Azure Policies Add-on\"\n         id = \"CKV_AZURE_116\"\n@@ -10,8 +12,20 @@\n         categories = [CheckCategories.NETWORKING]\n         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n \n-    def get_inspected_key(self):\n-        return \"addon_profile/[0]/azure_policy/[0]/enabled\"\n+    def scan_resource_conf(self, conf: Dict[str, List[Any]]) -> CheckResult:\n+        # since Azure provider v2.97.0\n+        azure_policy_enabled = conf.get(\"azure_policy_enabled\", [None])[0]\n+        if azure_policy_enabled:\n+            self.evaluated_keys = [\"azure_policy_enabled\"]\n+            return CheckResult.PASSED\n+        # up to and including Azure provider v2.96.0\n+        self.evaluated_keys = [\"addon_profile/[0]/azure_policy/[0]/enabled\"]\n+        addon_profile = conf.get(\"addon_profile\", [None])[0]\n+        if addon_profile and isinstance(addon_profile, dict):\n+            azure_policy = addon_profile.get(\"azure_policy\", [None])[0]\n+            if azure_policy and isinstance(azure_policy, dict) and azure_policy.get(\"enabled\", [None])[0]:\n+                return CheckResult.PASSED\n+        return CheckResult.FAILED\n \n \n check = AKSUsesAzurePoliciesAddon()\n", "issue": "CKV_AZURE_116 fails with Terraform Azure provider >= v.2.97.0\n**Describe the issue**\r\nThis issue is regarding CKV_AZURE_116.\r\nSince v2.97.0 of the Azure Terraform provider, the Azure policies add-on is enabled by setting\r\n\r\n```terraform\r\nazure_policy_enabled = true\r\n```\r\n\r\nas a top-level property in a `azurerm_kubernetes_cluster` resource definition, instead of the following\r\n\r\n```terraform\r\naddon_profile {\r\n  azure_policy {\r\n    enabled = true\r\n  }\r\n}\r\n```\r\nThe check should be updated to reflect the change.\r\n\r\n**Examples**\r\n```terraform\r\nresource \"azurerm_kubernetes_cluster\" \"example\" {\r\n  azure_policy_enabled = true\r\n}\r\n```\r\nshould pass the check for CKV_AZURE_116.\r\n\r\n**Version:**\r\n2.0.1160\r\n\r\n**Additional context**\r\nNone\r\n\r\nI will submit a PR to fix this.\n", "before_files": [{"content": "from checkov.common.models.enums import CheckCategories\nfrom checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck\n\n\nclass AKSUsesAzurePoliciesAddon(BaseResourceValueCheck):\n    def __init__(self):\n        name = \"Ensure that AKS uses Azure Policies Add-on\"\n        id = \"CKV_AZURE_116\"\n        supported_resources = ['azurerm_kubernetes_cluster']\n        categories = [CheckCategories.NETWORKING]\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def get_inspected_key(self):\n        return \"addon_profile/[0]/azure_policy/[0]/enabled\"\n\n\ncheck = AKSUsesAzurePoliciesAddon()\n", "path": "checkov/terraform/checks/resource/azure/AKSUsesAzurePoliciesAddon.py"}], "after_files": [{"content": "from typing import Dict, List, Any\n\nfrom checkov.common.models.enums import CheckCategories, CheckResult\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n\n\nclass AKSUsesAzurePoliciesAddon(BaseResourceCheck):\n    def __init__(self):\n        name = \"Ensure that AKS uses Azure Policies Add-on\"\n        id = \"CKV_AZURE_116\"\n        supported_resources = ['azurerm_kubernetes_cluster']\n        categories = [CheckCategories.NETWORKING]\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def scan_resource_conf(self, conf: Dict[str, List[Any]]) -> CheckResult:\n        # since Azure provider v2.97.0\n        azure_policy_enabled = conf.get(\"azure_policy_enabled\", [None])[0]\n        if azure_policy_enabled:\n            self.evaluated_keys = [\"azure_policy_enabled\"]\n            return CheckResult.PASSED\n        # up to and including Azure provider v2.96.0\n        self.evaluated_keys = [\"addon_profile/[0]/azure_policy/[0]/enabled\"]\n        addon_profile = conf.get(\"addon_profile\", [None])[0]\n        if addon_profile and isinstance(addon_profile, dict):\n            azure_policy = addon_profile.get(\"azure_policy\", [None])[0]\n            if azure_policy and isinstance(azure_policy, dict) and azure_policy.get(\"enabled\", [None])[0]:\n                return CheckResult.PASSED\n        return CheckResult.FAILED\n\n\ncheck = AKSUsesAzurePoliciesAddon()\n", "path": "checkov/terraform/checks/resource/azure/AKSUsesAzurePoliciesAddon.py"}]}