code: def generate_monitoring(cluster_name, cluster_dict, config):
      """Add the CloudWatch Monitoring module to the Terraform cluster dict.
  
      Example configuration:
  
      "cloudwatch_monitoring": {
        "enabled": true,
        "kinesis_alarms_enabled": true,
        "lambda_alarms_enabled": true,
        "settings": {
          "lambda_invocation_error_period": "600",
          "kinesis_iterator_age_error_period": "600",
          "kinesis_write_throughput_exceeded_threshold": "100"
        }
      }
  
      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
  
      Returns:
          bool: Result of applying the cloudwatch_monitoring module
      """
      prefix = config["global"]["account"]["prefix"]
      infrastructure_config = config["global"].get("infrastructure")
      monitoring_config = config["clusters"][cluster_name]["modules"][
          "cloudwatch_monitoring"
      ]
  
      if not (
          infrastructure_config
          and "monitoring" in infrastructure_config
      ):
          LOGGER.error(
              "Invalid config: Make sure you declare global infrastructure options!"
          )
          return False
  
      if not monitoring_config.get("enabled", False):
          LOGGER.info("CloudWatch Monitoring not enabled, skipping...")
          return True
  
      sns_topic_arn = monitoring_topic_arn(config)
  
      cluster_dict["module"][
          "cloudwatch_monitoring_{}".format(cluster_name)
      ] = {
          "source": "./modules/tf_monitoring",
          "sns_topic_arn": sns_topic_arn,
          "kinesis_alarms_enabled": False,
          "lambda_alarms_enabled": False,
      }
  
      if monitoring_config.get("lambda_alarms_enabled", True):
          cluster_dict["module"][
              "cloudwatch_monitoring_{}".format(cluster_name)
          ].update(
              {
                  "lambda_functions": [
                      "{}_{}_streamalert_classifier".format(
                          prefix, cluster_name
                      )
                  ],
                  "lambda_alarms_enabled": True,
              }
          )
  
      if monitoring_config.get("kinesis_alarms_enabled", True):
          cluster_dict["module"][
              "cloudwatch_monitoring_{}".format(cluster_name)
          ].update(
              {
                  "kinesis_stream": "${{module.kinesis_{}.stream_name}}".format(
                      cluster_name
                  ),
                  "kinesis_alarms_enabled": True,
              }
          )
  
      # Add support for custom settings for tweaking alarm thresholds, eval periods, and periods
      # Note: This does not strictly check for proper variable names, since there are so many.
      #       Instead, Terraform will error out if an improper name is used.
      #       Also, every value in these settings should be a string, so cast for safety.
      for setting_name, setting_value in monitoring_config.get(
          "settings", {}
      ).items():
          cluster_dict["module"][
              "cloudwatch_monitoring_{}".format(cluster_name)
          ][setting_name] = str(setting_value)
  
      return True
  
label_desc: Use image node_id 1 for calling a global function with example usage: generate_monitoring(cluster_name, cluster_dict, config) and returns: True, False, True