"""Ensure Snowflake provider uses the correct account name. During migration to 'delphi.us-east-1', all Snowflake providers must be updated away from the deprecated 'orchard' and a temporary 'dataplatform' accounts. """ from checkov.terraform.checks.provider.base_check import BaseProviderCheck from checkov.common.models.enums import CheckCategories, CheckResult from typing import Any DEPRECATED_ACCOUNTS = frozenset({"orchard", "dataplatform"}) class SnowflakeAccountName(BaseProviderCheck): def __init__(self): name = "Ensure Snowflake provider account_name is not set to a deprecated account ('orchard', 'dataplatform')" id = "ORCD_SNOWFLAKE_3" categories = [CheckCategories.CONVENTION] supported_provider = ["snowflake"] guideline = "https://www.notion.so/Checkov-guide-e5c30d67d35248ebbb0806df59775e0e" super().__init__(name=name, id=id, categories=categories, supported_provider=supported_provider, guideline=guideline) def scan_provider_conf(self, conf: dict[str, Any]) -> CheckResult: account_name = conf.get("account_name", [None])[0] if account_name in DEPRECATED_ACCOUNTS: return CheckResult.FAILED return CheckResult.PASSED check = SnowflakeAccountName()