code: def generate_cluster_cloudwatch_metric_filters(
      cluster_name, cluster_dict, config
  ):
      """Add the CloudWatch Metric Filters information to the Terraform cluster dict.
  
      Args:
          cluster_name (str): The name of the currently generating cluster
          cluster_dict (defaultdict): The dict containing all Terraform config for a given cluster.
          config (dict): The loaded config from the 'conf/' directory
      """
      streamalert_config = config["clusters"][cluster_name]
  
      current_metrics = metrics.MetricLogger.get_available_metrics()
  
      # Add custom metric filters for clustered function
      for func in CLUSTERED_FUNCTIONS:
          if func not in current_metrics:
              continue
  
          func_config_name = "{}_config".format(func)
          if func_config_name not in streamalert_config:
              continue
  
          if not streamalert_config[func_config_name].get(
              "enable_custom_metrics"
          ):
              continue
  
          metric_prefix = metrics.FUNC_PREFIXES[func]
  
          log_group_name = (
              "${{module.{}_{}_lambda.log_group_name}}".format(
                  func, cluster_name
              )
          )
  
          cluster_name = cluster_name.upper()
  
          # Add filters for the cluster and aggregate
          for metric, filter_settings in current_metrics[func].items():
              cluster_dict["module"][
                  "metric_filters_{}_{}_{}".format(
                      metric_prefix, metric, cluster_name
                  )
              ] = {
                  "source": "./modules/tf_metric_filters",
                  "log_group_name": log_group_name,
                  "metric_name": "{}-{}-{}".format(
                      metric_prefix, metric, cluster_name
                  ),
                  "metric_pattern": filter_settings[0],
                  "metric_value": filter_settings[1],
              }
  
file_path: streamalert/streamalert_cli/terraform/metrics.py
imports: from streamalert.shared import metrics
  from streamalert.shared import CLUSTERED_FUNCTIONS
  from streamalert.shared.logger import get_logger
  from streamalert_cli.terraform.common import infinitedict, monitoring_topic_arn
label_desc: Use image node_id 3 for calling a global function with example usage: generate_cluster_cloudwatch_metric_filters(cluster_name, cluster_dict, config) without return types