prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Unable to Evaluate Final Result from condition 
  **Describe the issue**
  CKV_GCP_43: "Ensure KMS encryption keys are rotated within a period of 90 days"
  
  **Examples**
  Check: CKV_GCP_43: "Ensure KMS encryption keys are rotated within a period of 90 days"
  	FAILED for resource: module.kms.google_kms_crypto_key.key
  	File: /main.tf:11-29
  	Calling File: /example/production/main.tf:1-6
  	Guide: https://docs.bridgecrew.io/docs/bc_gcp_general_4
  
  		11 | resource "google_kms_crypto_key" "key" {
  		12 |   count           = var.prevent_destroy ? length(var.keys) : 0
  		13 |   name            = var.keys[count.index]
  		14 |   key_ring        = google_kms_key_ring.key_ring.id
  		15 |   rotation_period = contains(["ASYMMETRIC_SIGN", "ASYMMETRIC_DECRYPT"], var.purpose) ? null : var.key_rotation_period
  		16 |   #rotation_period = var.key_rotation_period
  		17 |   purpose = var.purpose
  		18 |
  		19 |   lifecycle {
  		20 |     prevent_destroy = true
  		21 |   }
  		22 |
  		23 |   version_template {
  		24 |     algorithm        = var.key_algorithm
  		25 |     protection_level = var.key_protection_level
  		26 |   }
  		27 |
  		28 |   labels = var.labels
  		29 | }
  
  Checkov should providing error only in ASYMMETRIC key creation not the ENCRYPT_DCRYPT purpose for KMS key. Even after setting the purpose to ENCRYPT_DCRYPT and key_rotation_period variable to 90 days(7776000s), check is failing.
  **Version (please complete the following information):**
   - Checkov Version 2.3.156
  
  **Additional context**
  `contains(["ASYMMETRIC_SIGN", "ASYMMETRIC_DECRYPT"], var.purpose) ? null : var.key_rotation_period`
  Above line should be evaluated and marked as passed for GCP KMS as ASYMMETRIC key is not supporting Automatic rotation.
  
  
  --- 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/gcp/GoogleKMSRotationPeriod.py`
  Content:
  ```
  1 from typing import Dict, List, Any
  2 
  3 from checkov.common.util.type_forcers import force_int
  4 
  5 from checkov.common.models.enums import CheckResult, CheckCategories
  6 from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
  7 
  8 # rotation_period time unit is seconds
  9 ONE_DAY = 24 * 60 * 60
  10 NINETY_DAYS = 90 * ONE_DAY
  11 
  12 
  13 class GoogleKMSKeyRotationPeriod(BaseResourceCheck):
  14     def __init__(self) -> None:
  15         name = "Ensure KMS encryption keys are rotated within a period of 90 days"
  16         id = "CKV_GCP_43"
  17         supported_resources = ["google_kms_crypto_key"]
  18         categories = [CheckCategories.GENERAL_SECURITY]
  19         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
  20 
  21     def scan_resource_conf(self, conf: Dict[str, List[Any]]) -> CheckResult:
  22         self.evaluated_keys = ["rotation_period"]
  23         rotation = conf.get("rotation_period")
  24         if rotation and rotation[0]:
  25             time = force_int(rotation[0][:-1])
  26             if time and ONE_DAY <= time <= NINETY_DAYS:
  27                 return CheckResult.PASSED
  28         return CheckResult.FAILED
  29 
  30 
  31 check = GoogleKMSKeyRotationPeriod()
  32
  ```
  --- 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/gcp/GoogleKMSRotationPeriod.py b/checkov/terraform/checks/resource/gcp/GoogleKMSRotationPeriod.py
  --- a/checkov/terraform/checks/resource/gcp/GoogleKMSRotationPeriod.py
  +++ b/checkov/terraform/checks/resource/gcp/GoogleKMSRotationPeriod.py
  @@ -5,6 +5,7 @@
   from checkov.common.models.enums import CheckResult, CheckCategories
   from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
   
  +ASYMMETRIC_KEYS = {"ASYMMETRIC_DECRYPT", "ASYMMETRIC_SIGN"}
   # rotation_period time unit is seconds
   ONE_DAY = 24 * 60 * 60
   NINETY_DAYS = 90 * ONE_DAY
  @@ -14,11 +15,17 @@
       def __init__(self) -> None:
           name = "Ensure KMS encryption keys are rotated within a period of 90 days"
           id = "CKV_GCP_43"
  -        supported_resources = ["google_kms_crypto_key"]
  -        categories = [CheckCategories.GENERAL_SECURITY]
  +        supported_resources = ("google_kms_crypto_key",)
  +        categories = (CheckCategories.GENERAL_SECURITY,)
           super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
   
       def scan_resource_conf(self, conf: Dict[str, List[Any]]) -> CheckResult:
  +        purpose = conf.get("purpose")
  +        if purpose and isinstance(purpose, list) and purpose[0] in ASYMMETRIC_KEYS:
  +            # https://cloud.google.com/kms/docs/key-rotation#asymmetric
  +            # automatic key rotation is not supported for asymmetric keys
  +            return CheckResult.UNKNOWN
  +
           self.evaluated_keys = ["rotation_period"]
           rotation = conf.get("rotation_period")
           if rotation and rotation[0]:
  
verification_info: {"golden_diff": "diff --git a/checkov/terraform/checks/resource/gcp/GoogleKMSRotationPeriod.py b/checkov/terraform/checks/resource/gcp/GoogleKMSRotationPeriod.py\n--- a/checkov/terraform/checks/resource/gcp/GoogleKMSRotationPeriod.py\n+++ b/checkov/terraform/checks/resource/gcp/GoogleKMSRotationPeriod.py\n@@ -5,6 +5,7 @@\n from checkov.common.models.enums import CheckResult, CheckCategories\n from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n \n+ASYMMETRIC_KEYS = {\"ASYMMETRIC_DECRYPT\", \"ASYMMETRIC_SIGN\"}\n # rotation_period time unit is seconds\n ONE_DAY = 24 * 60 * 60\n NINETY_DAYS = 90 * ONE_DAY\n@@ -14,11 +15,17 @@\n     def __init__(self) -> None:\n         name = \"Ensure KMS encryption keys are rotated within a period of 90 days\"\n         id = \"CKV_GCP_43\"\n-        supported_resources = [\"google_kms_crypto_key\"]\n-        categories = [CheckCategories.GENERAL_SECURITY]\n+        supported_resources = (\"google_kms_crypto_key\",)\n+        categories = (CheckCategories.GENERAL_SECURITY,)\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+        purpose = conf.get(\"purpose\")\n+        if purpose and isinstance(purpose, list) and purpose[0] in ASYMMETRIC_KEYS:\n+            # https://cloud.google.com/kms/docs/key-rotation#asymmetric\n+            # automatic key rotation is not supported for asymmetric keys\n+            return CheckResult.UNKNOWN\n+\n         self.evaluated_keys = [\"rotation_period\"]\n         rotation = conf.get(\"rotation_period\")\n         if rotation and rotation[0]:\n", "issue": "Unable to Evaluate Final Result from condition \n**Describe the issue**\r\nCKV_GCP_43: \"Ensure KMS encryption keys are rotated within a period of 90 days\"\r\n\r\n**Examples**\r\nCheck: CKV_GCP_43: \"Ensure KMS encryption keys are rotated within a period of 90 days\"\r\n\tFAILED for resource: module.kms.google_kms_crypto_key.key\r\n\tFile: /main.tf:11-29\r\n\tCalling File: /example/production/main.tf:1-6\r\n\tGuide: https://docs.bridgecrew.io/docs/bc_gcp_general_4\r\n\r\n\t\t11 | resource \"google_kms_crypto_key\" \"key\" {\r\n\t\t12 |   count           = var.prevent_destroy ? length(var.keys) : 0\r\n\t\t13 |   name            = var.keys[count.index]\r\n\t\t14 |   key_ring        = google_kms_key_ring.key_ring.id\r\n\t\t15 |   rotation_period = contains([\"ASYMMETRIC_SIGN\", \"ASYMMETRIC_DECRYPT\"], var.purpose) ? null : var.key_rotation_period\r\n\t\t16 |   #rotation_period = var.key_rotation_period\r\n\t\t17 |   purpose = var.purpose\r\n\t\t18 |\r\n\t\t19 |   lifecycle {\r\n\t\t20 |     prevent_destroy = true\r\n\t\t21 |   }\r\n\t\t22 |\r\n\t\t23 |   version_template {\r\n\t\t24 |     algorithm        = var.key_algorithm\r\n\t\t25 |     protection_level = var.key_protection_level\r\n\t\t26 |   }\r\n\t\t27 |\r\n\t\t28 |   labels = var.labels\r\n\t\t29 | }\r\n\r\nCheckov should providing error only in ASYMMETRIC key creation not the ENCRYPT_DCRYPT purpose for KMS key. Even after setting the purpose to ENCRYPT_DCRYPT and key_rotation_period variable to 90 days(7776000s), check is failing.\r\n**Version (please complete the following information):**\r\n - Checkov Version 2.3.156\r\n\r\n**Additional context**\r\n`contains([\"ASYMMETRIC_SIGN\", \"ASYMMETRIC_DECRYPT\"], var.purpose) ? null : var.key_rotation_period`\r\nAbove line should be evaluated and marked as passed for GCP KMS as ASYMMETRIC key is not supporting Automatic rotation.\r\n\n", "before_files": [{"content": "from typing import Dict, List, Any\n\nfrom checkov.common.util.type_forcers import force_int\n\nfrom checkov.common.models.enums import CheckResult, CheckCategories\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n\n# rotation_period time unit is seconds\nONE_DAY = 24 * 60 * 60\nNINETY_DAYS = 90 * ONE_DAY\n\n\nclass GoogleKMSKeyRotationPeriod(BaseResourceCheck):\n    def __init__(self) -> None:\n        name = \"Ensure KMS encryption keys are rotated within a period of 90 days\"\n        id = \"CKV_GCP_43\"\n        supported_resources = [\"google_kms_crypto_key\"]\n        categories = [CheckCategories.GENERAL_SECURITY]\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        self.evaluated_keys = [\"rotation_period\"]\n        rotation = conf.get(\"rotation_period\")\n        if rotation and rotation[0]:\n            time = force_int(rotation[0][:-1])\n            if time and ONE_DAY <= time <= NINETY_DAYS:\n                return CheckResult.PASSED\n        return CheckResult.FAILED\n\n\ncheck = GoogleKMSKeyRotationPeriod()\n", "path": "checkov/terraform/checks/resource/gcp/GoogleKMSRotationPeriod.py"}], "after_files": [{"content": "from typing import Dict, List, Any\n\nfrom checkov.common.util.type_forcers import force_int\n\nfrom checkov.common.models.enums import CheckResult, CheckCategories\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n\nASYMMETRIC_KEYS = {\"ASYMMETRIC_DECRYPT\", \"ASYMMETRIC_SIGN\"}\n# rotation_period time unit is seconds\nONE_DAY = 24 * 60 * 60\nNINETY_DAYS = 90 * ONE_DAY\n\n\nclass GoogleKMSKeyRotationPeriod(BaseResourceCheck):\n    def __init__(self) -> None:\n        name = \"Ensure KMS encryption keys are rotated within a period of 90 days\"\n        id = \"CKV_GCP_43\"\n        supported_resources = (\"google_kms_crypto_key\",)\n        categories = (CheckCategories.GENERAL_SECURITY,)\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        purpose = conf.get(\"purpose\")\n        if purpose and isinstance(purpose, list) and purpose[0] in ASYMMETRIC_KEYS:\n            # https://cloud.google.com/kms/docs/key-rotation#asymmetric\n            # automatic key rotation is not supported for asymmetric keys\n            return CheckResult.UNKNOWN\n\n        self.evaluated_keys = [\"rotation_period\"]\n        rotation = conf.get(\"rotation_period\")\n        if rotation and rotation[0]:\n            time = force_int(rotation[0][:-1])\n            if time and ONE_DAY <= time <= NINETY_DAYS:\n                return CheckResult.PASSED\n        return CheckResult.FAILED\n\n\ncheck = GoogleKMSKeyRotationPeriod()\n", "path": "checkov/terraform/checks/resource/gcp/GoogleKMSRotationPeriod.py"}]}