prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  TypeError in SecretManagerSecret90days
  **Describe the issue**
  While running a scan on TF code, I'm getting a TypeError 
  
  
  **Examples**
  The relevant TF code is:
  ```
  resource "aws_secretsmanager_secret_rotation" "rds_password_rotation" {
    secret_id           = aws_secretsmanager_secret.credentials.id
    rotation_lambda_arn = "arn:..."
  
    rotation_rules {
      automatically_after_days = var.db_password_rotation_days
    }
  
  }
  
  variable "db_password_rotation_days" {
    description = "Number of days in which the RDS password will be rotated"
    type = number
  }
  
  ```
  **Exception Trace**
  ```
  Failed to run check CKV_AWS_304 on rds.tf:aws_secretsmanager_secret_rotation.rds_password_rotation
  Traceback (most recent call last):
    File "\venv\Lib\site-packages\checkov\common\checks\base_check.py", line 73, in run
      check_result["result"] = self.scan_entity_conf(entity_configuration, entity_type)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "\venv\Lib\site-packages\checkov\terraform\checks\resource\base_resource_check.py", line 43, in scan_entity_conf
      return self.scan_resource_conf(conf)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "\venv\Lib\site-packages\checkov\terraform\checks\resource\aws\SecretManagerSecret90days.py", line 20, in scan_resource_conf
      if days < 90:
         ^^^^^^^^^
  TypeError: '<' not supported between instances of 'str' and 'int'     
  ```
  
  **Desktop (please complete the following information):**
   - OS: Windows 10 for Workstation
   - Checkov Version 2.3.301
  
  **Additional context**
  I inspected the value of date at the line causing the error and it is the string `var.db_password_rotation_days`. 
  
  --- 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/aws/SecretManagerSecret90days.py`
  Content:
  ```
  1 
  2 from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
  3 from checkov.common.models.enums import CheckCategories, CheckResult
  4 
  5 
  6 class SecretManagerSecret90days(BaseResourceCheck):
  7 
  8     def __init__(self):
  9         name = "Ensure Secrets Manager secrets should be rotated within 90 days"
  10         id = "CKV_AWS_304"
  11         supported_resources = ["aws_secretsmanager_secret_rotation"]
  12         categories = [CheckCategories.GENERAL_SECURITY]
  13         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
  14 
  15     def scan_resource_conf(self, conf) -> CheckResult:
  16         if conf.get("rotation_rules") and isinstance(conf.get("rotation_rules"), list):
  17             rule = conf.get("rotation_rules")[0]
  18             if rule.get('automatically_after_days') and isinstance(rule.get('automatically_after_days'), list):
  19                 days = rule.get('automatically_after_days')[0]
  20                 if days < 90:
  21                     return CheckResult.PASSED
  22         return CheckResult.FAILED
  23 
  24 
  25 check = SecretManagerSecret90days()
  26
  ```
  --- 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/aws/SecretManagerSecret90days.py b/checkov/terraform/checks/resource/aws/SecretManagerSecret90days.py
  --- a/checkov/terraform/checks/resource/aws/SecretManagerSecret90days.py
  +++ b/checkov/terraform/checks/resource/aws/SecretManagerSecret90days.py
  @@ -1,23 +1,27 @@
  +from __future__ import annotations
   
  +from typing import Any
  +
  +from checkov.common.util.type_forcers import force_int
   from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
   from checkov.common.models.enums import CheckCategories, CheckResult
   
   
   class SecretManagerSecret90days(BaseResourceCheck):
  -
  -    def __init__(self):
  +    def __init__(self) -> None:
           name = "Ensure Secrets Manager secrets should be rotated within 90 days"
           id = "CKV_AWS_304"
  -        supported_resources = ["aws_secretsmanager_secret_rotation"]
  -        categories = [CheckCategories.GENERAL_SECURITY]
  +        supported_resources = ("aws_secretsmanager_secret_rotation",)
  +        categories = (CheckCategories.GENERAL_SECURITY,)
           super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
   
  -    def scan_resource_conf(self, conf) -> CheckResult:
  -        if conf.get("rotation_rules") and isinstance(conf.get("rotation_rules"), list):
  -            rule = conf.get("rotation_rules")[0]
  -            if rule.get('automatically_after_days') and isinstance(rule.get('automatically_after_days'), list):
  -                days = rule.get('automatically_after_days')[0]
  -                if days < 90:
  +    def scan_resource_conf(self, conf: dict[str, list[Any]]) -> CheckResult:
  +        rules = conf.get("rotation_rules")
  +        if rules and isinstance(rules, list):
  +            days = rules[0].get('automatically_after_days')
  +            if days and isinstance(days, list):
  +                days = force_int(days[0])
  +                if days is not None and days < 90:
                       return CheckResult.PASSED
           return CheckResult.FAILED
  
verification_info: {"golden_diff": "diff --git a/checkov/terraform/checks/resource/aws/SecretManagerSecret90days.py b/checkov/terraform/checks/resource/aws/SecretManagerSecret90days.py\n--- a/checkov/terraform/checks/resource/aws/SecretManagerSecret90days.py\n+++ b/checkov/terraform/checks/resource/aws/SecretManagerSecret90days.py\n@@ -1,23 +1,27 @@\n+from __future__ import annotations\n \n+from typing import Any\n+\n+from checkov.common.util.type_forcers import force_int\n from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n from checkov.common.models.enums import CheckCategories, CheckResult\n \n \n class SecretManagerSecret90days(BaseResourceCheck):\n-\n-    def __init__(self):\n+    def __init__(self) -> None:\n         name = \"Ensure Secrets Manager secrets should be rotated within 90 days\"\n         id = \"CKV_AWS_304\"\n-        supported_resources = [\"aws_secretsmanager_secret_rotation\"]\n-        categories = [CheckCategories.GENERAL_SECURITY]\n+        supported_resources = (\"aws_secretsmanager_secret_rotation\",)\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) -> CheckResult:\n-        if conf.get(\"rotation_rules\") and isinstance(conf.get(\"rotation_rules\"), list):\n-            rule = conf.get(\"rotation_rules\")[0]\n-            if rule.get('automatically_after_days') and isinstance(rule.get('automatically_after_days'), list):\n-                days = rule.get('automatically_after_days')[0]\n-                if days < 90:\n+    def scan_resource_conf(self, conf: dict[str, list[Any]]) -> CheckResult:\n+        rules = conf.get(\"rotation_rules\")\n+        if rules and isinstance(rules, list):\n+            days = rules[0].get('automatically_after_days')\n+            if days and isinstance(days, list):\n+                days = force_int(days[0])\n+                if days is not None and days < 90:\n                     return CheckResult.PASSED\n         return CheckResult.FAILED\n", "issue": "TypeError in SecretManagerSecret90days\n**Describe the issue**\r\nWhile running a scan on TF code, I'm getting a TypeError \r\n\r\n\r\n**Examples**\r\nThe relevant TF code is:\r\n```\r\nresource \"aws_secretsmanager_secret_rotation\" \"rds_password_rotation\" {\r\n  secret_id           = aws_secretsmanager_secret.credentials.id\r\n  rotation_lambda_arn = \"arn:...\"\r\n\r\n  rotation_rules {\r\n    automatically_after_days = var.db_password_rotation_days\r\n  }\r\n\r\n}\r\n\r\nvariable \"db_password_rotation_days\" {\r\n  description = \"Number of days in which the RDS password will be rotated\"\r\n  type = number\r\n}\r\n\r\n```\r\n**Exception Trace**\r\n```\r\nFailed to run check CKV_AWS_304 on rds.tf:aws_secretsmanager_secret_rotation.rds_password_rotation\r\nTraceback (most recent call last):\r\n  File \"\\venv\\Lib\\site-packages\\checkov\\common\\checks\\base_check.py\", line 73, in run\r\n    check_result[\"result\"] = self.scan_entity_conf(entity_configuration, entity_type)\r\n                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"\\venv\\Lib\\site-packages\\checkov\\terraform\\checks\\resource\\base_resource_check.py\", line 43, in scan_entity_conf\r\n    return self.scan_resource_conf(conf)\r\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"\\venv\\Lib\\site-packages\\checkov\\terraform\\checks\\resource\\aws\\SecretManagerSecret90days.py\", line 20, in scan_resource_conf\r\n    if days < 90:\r\n       ^^^^^^^^^\r\nTypeError: '<' not supported between instances of 'str' and 'int'     \r\n```\r\n\r\n**Desktop (please complete the following information):**\r\n - OS: Windows 10 for Workstation\r\n - Checkov Version 2.3.301\r\n\r\n**Additional context**\r\nI inspected the value of date at the line causing the error and it is the string `var.db_password_rotation_days`. \n", "before_files": [{"content": "\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\nfrom checkov.common.models.enums import CheckCategories, CheckResult\n\n\nclass SecretManagerSecret90days(BaseResourceCheck):\n\n    def __init__(self):\n        name = \"Ensure Secrets Manager secrets should be rotated within 90 days\"\n        id = \"CKV_AWS_304\"\n        supported_resources = [\"aws_secretsmanager_secret_rotation\"]\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) -> CheckResult:\n        if conf.get(\"rotation_rules\") and isinstance(conf.get(\"rotation_rules\"), list):\n            rule = conf.get(\"rotation_rules\")[0]\n            if rule.get('automatically_after_days') and isinstance(rule.get('automatically_after_days'), list):\n                days = rule.get('automatically_after_days')[0]\n                if days < 90:\n                    return CheckResult.PASSED\n        return CheckResult.FAILED\n\n\ncheck = SecretManagerSecret90days()\n", "path": "checkov/terraform/checks/resource/aws/SecretManagerSecret90days.py"}], "after_files": [{"content": "from __future__ import annotations\n\nfrom typing import Any\n\nfrom checkov.common.util.type_forcers import force_int\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\nfrom checkov.common.models.enums import CheckCategories, CheckResult\n\n\nclass SecretManagerSecret90days(BaseResourceCheck):\n    def __init__(self) -> None:\n        name = \"Ensure Secrets Manager secrets should be rotated within 90 days\"\n        id = \"CKV_AWS_304\"\n        supported_resources = (\"aws_secretsmanager_secret_rotation\",)\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        rules = conf.get(\"rotation_rules\")\n        if rules and isinstance(rules, list):\n            days = rules[0].get('automatically_after_days')\n            if days and isinstance(days, list):\n                days = force_int(days[0])\n                if days is not None and days < 90:\n                    return CheckResult.PASSED\n        return CheckResult.FAILED\n\n\ncheck = SecretManagerSecret90days()\n", "path": "checkov/terraform/checks/resource/aws/SecretManagerSecret90days.py"}]}