We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
CKV_AWS_233 Ensure Create before destroy for ACM certificates false positive reading plan
**Describe the issue**
This check raises a false positive for the following resource which does have that lifecycle hook enabled.

**Examples**

Checkov run with:

```
checkov --file plan.json --output junitxml --output cli --output-file-path checkov-out --repo-root-for-plan-enrichment . --download-external-modules True > out.log 2>&1
```

Section in the plan.json:

```
{
  "address": "module.my_module.aws_acm_certificate.my_cert",
  "mode": "managed",
  "type": "aws_acm_certificate",
  "name": "my_cert",
  "provider_name": "registry.terraform.io/hashicorp/aws",
  "schema_version": 0,
  "values": {
    "arn": "CENSORED",
    "certificate_authority_arn": "",
    "certificate_body": null,
    "certificate_chain": null,
    "domain_name": "CENSORED",
    "domain_validation_options": [
      {
        "domain_name": "CENSORED",
        "resource_record_name": "CENSORED",
        "resource_record_type": "CNAME",
        "resource_record_value": "CENSORED"
      }
    ],
    "id": "CENSORED",
    "options": [
      {
        "certificate_transparency_logging_preference": "ENABLED"
      }
    ],
    "private_key": null,
    "status": "ISSUED",
    "subject_alternative_names": [
      "CENSORED"
    ],
    "tags": {},
    "tags_all": {},
    "validation_emails": [],
    "validation_method": "DNS",
    "validation_option": []
  },
  "sensitive_values": {
    "domain_validation_options": [
      {}
    ],
    "options": [
      {}
    ],
    "subject_alternative_names": [
      false
    ],
    "tags": {},
    "tags_all": {},
    "validation_emails": [],
    "validation_option": []
  }
}

```

Terraform code:

```terraform
resource "aws_acm_certificate" "my_cert" {
  domain_name       = local.domain_name
  validation_method = "DNS"

  lifecycle {
    create_before_destroy = true
  }
}
```

Error:

```
Check: CKV_AWS_233: "Ensure Create before destroy for ACM certificates"
	FAILED for resource: aws_acm_certificate.my_cert
	File: ../my-file.tf:1-8

		1 | resource "aws_acm_certificate" "my_cert" {
		2 |   domain_name       = local.domain_name
		3 |   validation_method = "DNS"
		4 | 
		5 |   lifecycle {
		6 |     create_before_destroy = true
		7 |   }
		8 | }
```

**Version:**
 - Checkov Version: 2.0.1200

**Additional context**
Add any other context about the problem here.


--- 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/plan_runner.py`
Content:
```
1 import logging
2 import os
3 import platform
4 
5 from typing import Optional, List, Type
6 
7 from checkov.common.graph.checks_infra.registry import BaseRegistry
8 from checkov.common.graph.db_connectors.networkx.networkx_db_connector import NetworkxConnector
9 from checkov.terraform.graph_manager import TerraformGraphManager
10 from checkov.terraform.graph_builder.local_graph import TerraformLocalGraph
11 from checkov.common.graph.graph_builder.local_graph import LocalGraph
12 from checkov.common.checks_infra.registry import get_graph_checks_registry
13 from checkov.common.graph.graph_builder.graph_components.attribute_names import CustomAttributes
14 from checkov.common.output.record import Record
15 from checkov.common.output.report import Report, CheckType
16 from checkov.common.runners.base_runner import CHECKOV_CREATE_GRAPH
17 from checkov.runner_filter import RunnerFilter
18 from checkov.terraform.checks.resource.registry import resource_registry
19 from checkov.terraform.context_parsers.registry import parser_registry
20 from checkov.terraform.plan_utils import create_definitions, build_definitions_context
21 from checkov.terraform.runner import Runner as TerraformRunner, merge_reports
22 
23 
24 class Runner(TerraformRunner):
25     check_type = CheckType.TERRAFORM_PLAN
26 
27     def __init__(self, graph_class: Type[LocalGraph] = TerraformLocalGraph,
28                  graph_manager: Optional[TerraformGraphManager] = None,
29                  db_connector: NetworkxConnector = NetworkxConnector(),
30                  external_registries: Optional[List[BaseRegistry]] = None,
31                  source: str = "Terraform"):
32         super().__init__(graph_class=graph_class, graph_manager=graph_manager, db_connector=db_connector,
33                          external_registries=external_registries, source=source)
34         self.file_extensions = ['.json']  # override what gets set from the TF runner
35         self.definitions = None
36         self.context = None
37         self.graph_registry = get_graph_checks_registry(super().check_type)
38 
39     block_type_registries = {
40         'resource': resource_registry,
41     }
42 
43     def run(
44             self,
45             root_folder: Optional[str] = None,
46             external_checks_dir: Optional[List[str]] = None,
47             files: Optional[List[str]] = None,
48             runner_filter: RunnerFilter = RunnerFilter(),
49             collect_skip_comments: bool = True
50     ) -> Report:
51         report = Report(self.check_type)
52         parsing_errors = {}
53         if self.definitions is None or self.context is None:
54             self.definitions, definitions_raw = create_definitions(root_folder, files, runner_filter, parsing_errors)
55             self.context = build_definitions_context(self.definitions, definitions_raw)
56             if CHECKOV_CREATE_GRAPH:
57                 graph = self.graph_manager.build_graph_from_definitions(self.definitions, render_variables=False)
58                 self.graph_manager.save_graph(graph)
59 
60         if external_checks_dir:
61             for directory in external_checks_dir:
62                 resource_registry.load_external_checks(directory)
63                 self.graph_registry.load_external_checks(directory)
64         self.check_tf_definition(report, root_folder, runner_filter)
65         report.add_parsing_errors(parsing_errors.keys())
66 
67         if self.definitions:
68             graph_report = self.get_graph_checks_report(root_folder, runner_filter)
69             merge_reports(report, graph_report)
70         return report
71 
72     def check_tf_definition(self, report, root_folder, runner_filter, collect_skip_comments=True):
73         for full_file_path, definition in self.definitions.items():
74             if platform.system() == "Windows":
75                 temp = os.path.split(full_file_path)[0]
76                 scanned_file = f"/{os.path.relpath(full_file_path,temp)}"
77             else:
78                 scanned_file = f"/{os.path.relpath(full_file_path)}"
79             logging.debug(f"Scanning file: {scanned_file}")
80             for block_type in definition.keys():
81                 if block_type in self.block_type_registries.keys():
82                     self.run_block(definition[block_type], None, full_file_path, root_folder, report, scanned_file,
83                                    block_type, runner_filter)
84 
85     def run_block(self, entities,
86                   definition_context,
87                   full_file_path, root_folder, report, scanned_file,
88                   block_type, runner_filter=None, entity_context_path_header=None,
89                   module_referrer: Optional[str] = None):
90         registry = self.block_type_registries[block_type]
91         if registry:
92             for entity in entities:
93                 context_parser = parser_registry.context_parsers[block_type]
94                 definition_path = context_parser.get_entity_context_path(entity)
95                 entity_id = ".".join(definition_path)
96                 # Entity can exist only once per dir, for file as well
97                 entity_context = self.get_entity_context(definition_path, full_file_path)
98                 entity_lines_range = [entity_context.get('start_line'), entity_context.get('end_line')]
99                 entity_code_lines = entity_context.get('code_lines')
100                 entity_address = entity_context.get('address')
101 
102                 results = registry.scan(scanned_file, entity, [], runner_filter)
103                 for check, check_result in results.items():
104                     record = Record(check_id=check.id, bc_check_id=check.bc_id, check_name=check.name,
105                                     check_result=check_result,
106                                     code_block=entity_code_lines, file_path=scanned_file,
107                                     file_line_range=entity_lines_range,
108                                     resource=entity_id, resource_address=entity_address, evaluations=None,
109                                     check_class=check.__class__.__module__, file_abs_path=full_file_path,
110                                     severity=check.severity)
111                     record.set_guideline(check.guideline)
112                     report.add_record(record=record)
113 
114     def get_entity_context_and_evaluations(self, entity):
115         raw_context = self.get_entity_context(entity[CustomAttributes.BLOCK_NAME].split("."),
116                                               entity[CustomAttributes.FILE_PATH])
117         raw_context['definition_path'] = entity[CustomAttributes.BLOCK_NAME].split('.')
118         return raw_context, None
119 
120     def get_entity_context(self, definition_path, full_file_path):
121         entity_id = ".".join(definition_path)
122         return self.context.get(full_file_path, {}).get(entity_id)
123
```
--- 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()

```

diff --git a/checkov/terraform/plan_runner.py b/checkov/terraform/plan_runner.py
--- a/checkov/terraform/plan_runner.py
+++ b/checkov/terraform/plan_runner.py
@@ -20,6 +20,14 @@
 from checkov.terraform.plan_utils import create_definitions, build_definitions_context
 from checkov.terraform.runner import Runner as TerraformRunner, merge_reports
 
+# set of check IDs with lifecycle condition
+TF_LIFECYCLE_CHECK_IDS = {
+    "CKV_AWS_217",
+    "CKV_AWS_233",
+    "CKV_AWS_237",
+    "CKV_GCP_82",
+}
+
 
 class Runner(TerraformRunner):
     check_type = CheckType.TERRAFORM_PLAN
@@ -101,6 +109,10 @@
 
                 results = registry.scan(scanned_file, entity, [], runner_filter)
                 for check, check_result in results.items():
+                    if check.id in TF_LIFECYCLE_CHECK_IDS:
+                        # can't be evaluated in TF plan
+                        continue
+
                     record = Record(check_id=check.id, bc_check_id=check.bc_id, check_name=check.name,
                                     check_result=check_result,
                                     code_block=entity_code_lines, file_path=scanned_file,

{"golden_diff": "diff --git a/checkov/terraform/plan_runner.py b/checkov/terraform/plan_runner.py\n--- a/checkov/terraform/plan_runner.py\n+++ b/checkov/terraform/plan_runner.py\n@@ -20,6 +20,14 @@\n from checkov.terraform.plan_utils import create_definitions, build_definitions_context\n from checkov.terraform.runner import Runner as TerraformRunner, merge_reports\n \n+# set of check IDs with lifecycle condition\n+TF_LIFECYCLE_CHECK_IDS = {\n+    \"CKV_AWS_217\",\n+    \"CKV_AWS_233\",\n+    \"CKV_AWS_237\",\n+    \"CKV_GCP_82\",\n+}\n+\n \n class Runner(TerraformRunner):\n     check_type = CheckType.TERRAFORM_PLAN\n@@ -101,6 +109,10 @@\n \n                 results = registry.scan(scanned_file, entity, [], runner_filter)\n                 for check, check_result in results.items():\n+                    if check.id in TF_LIFECYCLE_CHECK_IDS:\n+                        # can't be evaluated in TF plan\n+                        continue\n+\n                     record = Record(check_id=check.id, bc_check_id=check.bc_id, check_name=check.name,\n                                     check_result=check_result,\n                                     code_block=entity_code_lines, file_path=scanned_file,\n", "issue": "CKV_AWS_233 Ensure Create before destroy for ACM certificates false positive reading plan\n**Describe the issue**\r\nThis check raises a false positive for the following resource which does have that lifecycle hook enabled.\r\n\r\n**Examples**\r\n\r\nCheckov run with:\r\n\r\n```\r\ncheckov --file plan.json --output junitxml --output cli --output-file-path checkov-out --repo-root-for-plan-enrichment . --download-external-modules True > out.log 2>&1\r\n```\r\n\r\nSection in the plan.json:\r\n\r\n```\r\n{\r\n  \"address\": \"module.my_module.aws_acm_certificate.my_cert\",\r\n  \"mode\": \"managed\",\r\n  \"type\": \"aws_acm_certificate\",\r\n  \"name\": \"my_cert\",\r\n  \"provider_name\": \"registry.terraform.io/hashicorp/aws\",\r\n  \"schema_version\": 0,\r\n  \"values\": {\r\n    \"arn\": \"CENSORED\",\r\n    \"certificate_authority_arn\": \"\",\r\n    \"certificate_body\": null,\r\n    \"certificate_chain\": null,\r\n    \"domain_name\": \"CENSORED\",\r\n    \"domain_validation_options\": [\r\n      {\r\n        \"domain_name\": \"CENSORED\",\r\n        \"resource_record_name\": \"CENSORED\",\r\n        \"resource_record_type\": \"CNAME\",\r\n        \"resource_record_value\": \"CENSORED\"\r\n      }\r\n    ],\r\n    \"id\": \"CENSORED\",\r\n    \"options\": [\r\n      {\r\n        \"certificate_transparency_logging_preference\": \"ENABLED\"\r\n      }\r\n    ],\r\n    \"private_key\": null,\r\n    \"status\": \"ISSUED\",\r\n    \"subject_alternative_names\": [\r\n      \"CENSORED\"\r\n    ],\r\n    \"tags\": {},\r\n    \"tags_all\": {},\r\n    \"validation_emails\": [],\r\n    \"validation_method\": \"DNS\",\r\n    \"validation_option\": []\r\n  },\r\n  \"sensitive_values\": {\r\n    \"domain_validation_options\": [\r\n      {}\r\n    ],\r\n    \"options\": [\r\n      {}\r\n    ],\r\n    \"subject_alternative_names\": [\r\n      false\r\n    ],\r\n    \"tags\": {},\r\n    \"tags_all\": {},\r\n    \"validation_emails\": [],\r\n    \"validation_option\": []\r\n  }\r\n}\r\n\r\n```\r\n\r\nTerraform code:\r\n\r\n```terraform\r\nresource \"aws_acm_certificate\" \"my_cert\" {\r\n  domain_name       = local.domain_name\r\n  validation_method = \"DNS\"\r\n\r\n  lifecycle {\r\n    create_before_destroy = true\r\n  }\r\n}\r\n```\r\n\r\nError:\r\n\r\n```\r\nCheck: CKV_AWS_233: \"Ensure Create before destroy for ACM certificates\"\r\n\tFAILED for resource: aws_acm_certificate.my_cert\r\n\tFile: ../my-file.tf:1-8\r\n\r\n\t\t1 | resource \"aws_acm_certificate\" \"my_cert\" {\r\n\t\t2 |   domain_name       = local.domain_name\r\n\t\t3 |   validation_method = \"DNS\"\r\n\t\t4 | \r\n\t\t5 |   lifecycle {\r\n\t\t6 |     create_before_destroy = true\r\n\t\t7 |   }\r\n\t\t8 | }\r\n```\r\n\r\n**Version:**\r\n - Checkov Version: 2.0.1200\r\n\r\n**Additional context**\r\nAdd any other context about the problem here.\r\n\n", "before_files": [{"content": "import logging\nimport os\nimport platform\n\nfrom typing import Optional, List, Type\n\nfrom checkov.common.graph.checks_infra.registry import BaseRegistry\nfrom checkov.common.graph.db_connectors.networkx.networkx_db_connector import NetworkxConnector\nfrom checkov.terraform.graph_manager import TerraformGraphManager\nfrom checkov.terraform.graph_builder.local_graph import TerraformLocalGraph\nfrom checkov.common.graph.graph_builder.local_graph import LocalGraph\nfrom checkov.common.checks_infra.registry import get_graph_checks_registry\nfrom checkov.common.graph.graph_builder.graph_components.attribute_names import CustomAttributes\nfrom checkov.common.output.record import Record\nfrom checkov.common.output.report import Report, CheckType\nfrom checkov.common.runners.base_runner import CHECKOV_CREATE_GRAPH\nfrom checkov.runner_filter import RunnerFilter\nfrom checkov.terraform.checks.resource.registry import resource_registry\nfrom checkov.terraform.context_parsers.registry import parser_registry\nfrom checkov.terraform.plan_utils import create_definitions, build_definitions_context\nfrom checkov.terraform.runner import Runner as TerraformRunner, merge_reports\n\n\nclass Runner(TerraformRunner):\n    check_type = CheckType.TERRAFORM_PLAN\n\n    def __init__(self, graph_class: Type[LocalGraph] = TerraformLocalGraph,\n                 graph_manager: Optional[TerraformGraphManager] = None,\n                 db_connector: NetworkxConnector = NetworkxConnector(),\n                 external_registries: Optional[List[BaseRegistry]] = None,\n                 source: str = \"Terraform\"):\n        super().__init__(graph_class=graph_class, graph_manager=graph_manager, db_connector=db_connector,\n                         external_registries=external_registries, source=source)\n        self.file_extensions = ['.json']  # override what gets set from the TF runner\n        self.definitions = None\n        self.context = None\n        self.graph_registry = get_graph_checks_registry(super().check_type)\n\n    block_type_registries = {\n        'resource': resource_registry,\n    }\n\n    def run(\n            self,\n            root_folder: Optional[str] = None,\n            external_checks_dir: Optional[List[str]] = None,\n            files: Optional[List[str]] = None,\n            runner_filter: RunnerFilter = RunnerFilter(),\n            collect_skip_comments: bool = True\n    ) -> Report:\n        report = Report(self.check_type)\n        parsing_errors = {}\n        if self.definitions is None or self.context is None:\n            self.definitions, definitions_raw = create_definitions(root_folder, files, runner_filter, parsing_errors)\n            self.context = build_definitions_context(self.definitions, definitions_raw)\n            if CHECKOV_CREATE_GRAPH:\n                graph = self.graph_manager.build_graph_from_definitions(self.definitions, render_variables=False)\n                self.graph_manager.save_graph(graph)\n\n        if external_checks_dir:\n            for directory in external_checks_dir:\n                resource_registry.load_external_checks(directory)\n                self.graph_registry.load_external_checks(directory)\n        self.check_tf_definition(report, root_folder, runner_filter)\n        report.add_parsing_errors(parsing_errors.keys())\n\n        if self.definitions:\n            graph_report = self.get_graph_checks_report(root_folder, runner_filter)\n            merge_reports(report, graph_report)\n        return report\n\n    def check_tf_definition(self, report, root_folder, runner_filter, collect_skip_comments=True):\n        for full_file_path, definition in self.definitions.items():\n            if platform.system() == \"Windows\":\n                temp = os.path.split(full_file_path)[0]\n                scanned_file = f\"/{os.path.relpath(full_file_path,temp)}\"\n            else:\n                scanned_file = f\"/{os.path.relpath(full_file_path)}\"\n            logging.debug(f\"Scanning file: {scanned_file}\")\n            for block_type in definition.keys():\n                if block_type in self.block_type_registries.keys():\n                    self.run_block(definition[block_type], None, full_file_path, root_folder, report, scanned_file,\n                                   block_type, runner_filter)\n\n    def run_block(self, entities,\n                  definition_context,\n                  full_file_path, root_folder, report, scanned_file,\n                  block_type, runner_filter=None, entity_context_path_header=None,\n                  module_referrer: Optional[str] = None):\n        registry = self.block_type_registries[block_type]\n        if registry:\n            for entity in entities:\n                context_parser = parser_registry.context_parsers[block_type]\n                definition_path = context_parser.get_entity_context_path(entity)\n                entity_id = \".\".join(definition_path)\n                # Entity can exist only once per dir, for file as well\n                entity_context = self.get_entity_context(definition_path, full_file_path)\n                entity_lines_range = [entity_context.get('start_line'), entity_context.get('end_line')]\n                entity_code_lines = entity_context.get('code_lines')\n                entity_address = entity_context.get('address')\n\n                results = registry.scan(scanned_file, entity, [], runner_filter)\n                for check, check_result in results.items():\n                    record = Record(check_id=check.id, bc_check_id=check.bc_id, check_name=check.name,\n                                    check_result=check_result,\n                                    code_block=entity_code_lines, file_path=scanned_file,\n                                    file_line_range=entity_lines_range,\n                                    resource=entity_id, resource_address=entity_address, evaluations=None,\n                                    check_class=check.__class__.__module__, file_abs_path=full_file_path,\n                                    severity=check.severity)\n                    record.set_guideline(check.guideline)\n                    report.add_record(record=record)\n\n    def get_entity_context_and_evaluations(self, entity):\n        raw_context = self.get_entity_context(entity[CustomAttributes.BLOCK_NAME].split(\".\"),\n                                              entity[CustomAttributes.FILE_PATH])\n        raw_context['definition_path'] = entity[CustomAttributes.BLOCK_NAME].split('.')\n        return raw_context, None\n\n    def get_entity_context(self, definition_path, full_file_path):\n        entity_id = \".\".join(definition_path)\n        return self.context.get(full_file_path, {}).get(entity_id)\n", "path": "checkov/terraform/plan_runner.py"}], "after_files": [{"content": "import logging\nimport os\nimport platform\n\nfrom typing import Optional, List, Type\n\nfrom checkov.common.graph.checks_infra.registry import BaseRegistry\nfrom checkov.common.graph.db_connectors.networkx.networkx_db_connector import NetworkxConnector\nfrom checkov.terraform.graph_manager import TerraformGraphManager\nfrom checkov.terraform.graph_builder.local_graph import TerraformLocalGraph\nfrom checkov.common.graph.graph_builder.local_graph import LocalGraph\nfrom checkov.common.checks_infra.registry import get_graph_checks_registry\nfrom checkov.common.graph.graph_builder.graph_components.attribute_names import CustomAttributes\nfrom checkov.common.output.record import Record\nfrom checkov.common.output.report import Report, CheckType\nfrom checkov.common.runners.base_runner import CHECKOV_CREATE_GRAPH\nfrom checkov.runner_filter import RunnerFilter\nfrom checkov.terraform.checks.resource.registry import resource_registry\nfrom checkov.terraform.context_parsers.registry import parser_registry\nfrom checkov.terraform.plan_utils import create_definitions, build_definitions_context\nfrom checkov.terraform.runner import Runner as TerraformRunner, merge_reports\n\n# set of check IDs with lifecycle condition\nTF_LIFECYCLE_CHECK_IDS = {\n    \"CKV_AWS_217\",\n    \"CKV_AWS_233\",\n    \"CKV_AWS_237\",\n    \"CKV_GCP_82\",\n}\n\n\nclass Runner(TerraformRunner):\n    check_type = CheckType.TERRAFORM_PLAN\n\n    def __init__(self, graph_class: Type[LocalGraph] = TerraformLocalGraph,\n                 graph_manager: Optional[TerraformGraphManager] = None,\n                 db_connector: NetworkxConnector = NetworkxConnector(),\n                 external_registries: Optional[List[BaseRegistry]] = None,\n                 source: str = \"Terraform\"):\n        super().__init__(graph_class=graph_class, graph_manager=graph_manager, db_connector=db_connector,\n                         external_registries=external_registries, source=source)\n        self.file_extensions = ['.json']  # override what gets set from the TF runner\n        self.definitions = None\n        self.context = None\n        self.graph_registry = get_graph_checks_registry(super().check_type)\n\n    block_type_registries = {\n        'resource': resource_registry,\n    }\n\n    def run(\n            self,\n            root_folder: Optional[str] = None,\n            external_checks_dir: Optional[List[str]] = None,\n            files: Optional[List[str]] = None,\n            runner_filter: RunnerFilter = RunnerFilter(),\n            collect_skip_comments: bool = True\n    ) -> Report:\n        report = Report(self.check_type)\n        parsing_errors = {}\n        if self.definitions is None or self.context is None:\n            self.definitions, definitions_raw = create_definitions(root_folder, files, runner_filter, parsing_errors)\n            self.context = build_definitions_context(self.definitions, definitions_raw)\n            if CHECKOV_CREATE_GRAPH:\n                graph = self.graph_manager.build_graph_from_definitions(self.definitions, render_variables=False)\n                self.graph_manager.save_graph(graph)\n\n        if external_checks_dir:\n            for directory in external_checks_dir:\n                resource_registry.load_external_checks(directory)\n                self.graph_registry.load_external_checks(directory)\n        self.check_tf_definition(report, root_folder, runner_filter)\n        report.add_parsing_errors(parsing_errors.keys())\n\n        if self.definitions:\n            graph_report = self.get_graph_checks_report(root_folder, runner_filter)\n            merge_reports(report, graph_report)\n        return report\n\n    def check_tf_definition(self, report, root_folder, runner_filter, collect_skip_comments=True):\n        for full_file_path, definition in self.definitions.items():\n            if platform.system() == \"Windows\":\n                temp = os.path.split(full_file_path)[0]\n                scanned_file = f\"/{os.path.relpath(full_file_path,temp)}\"\n            else:\n                scanned_file = f\"/{os.path.relpath(full_file_path)}\"\n            logging.debug(f\"Scanning file: {scanned_file}\")\n            for block_type in definition.keys():\n                if block_type in self.block_type_registries.keys():\n                    self.run_block(definition[block_type], None, full_file_path, root_folder, report, scanned_file,\n                                   block_type, runner_filter)\n\n    def run_block(self, entities,\n                  definition_context,\n                  full_file_path, root_folder, report, scanned_file,\n                  block_type, runner_filter=None, entity_context_path_header=None,\n                  module_referrer: Optional[str] = None):\n        registry = self.block_type_registries[block_type]\n        if registry:\n            for entity in entities:\n                context_parser = parser_registry.context_parsers[block_type]\n                definition_path = context_parser.get_entity_context_path(entity)\n                entity_id = \".\".join(definition_path)\n                # Entity can exist only once per dir, for file as well\n                entity_context = self.get_entity_context(definition_path, full_file_path)\n                entity_lines_range = [entity_context.get('start_line'), entity_context.get('end_line')]\n                entity_code_lines = entity_context.get('code_lines')\n                entity_address = entity_context.get('address')\n\n                results = registry.scan(scanned_file, entity, [], runner_filter)\n                for check, check_result in results.items():\n                    if check.id in TF_LIFECYCLE_CHECK_IDS:\n                        # can't be evaluated in TF plan\n                        continue\n\n                    record = Record(check_id=check.id, bc_check_id=check.bc_id, check_name=check.name,\n                                    check_result=check_result,\n                                    code_block=entity_code_lines, file_path=scanned_file,\n                                    file_line_range=entity_lines_range,\n                                    resource=entity_id, resource_address=entity_address, evaluations=None,\n                                    check_class=check.__class__.__module__, file_abs_path=full_file_path,\n                                    severity=check.severity)\n                    record.set_guideline(check.guideline)\n                    report.add_record(record=record)\n\n    def get_entity_context_and_evaluations(self, entity):\n        raw_context = self.get_entity_context(entity[CustomAttributes.BLOCK_NAME].split(\".\"),\n                                              entity[CustomAttributes.FILE_PATH])\n        raw_context['definition_path'] = entity[CustomAttributes.BLOCK_NAME].split('.')\n        return raw_context, None\n\n    def get_entity_context(self, definition_path, full_file_path):\n        entity_id = \".\".join(definition_path)\n        return self.context.get(full_file_path, {}).get(entity_id)\n", "path": "checkov/terraform/plan_runner.py"}]}