code: def __init__(
      self,
      provider_config: Dict[str, Any],
      node_id: str,
      cluster_name: str,
  ) -> None:
      self.node_id = node_id
      self.cluster_name = cluster_name
      self.provider_config = provider_config
      region = provider_config["region"]
      self.ec2_resource = resource_cache("ec2", region)
      self.ec2_client = self.ec2_resource.meta.client
      self.ssm_client = client_cache("ssm", region)
      cloudwatch_resource = resource_cache("cloudwatch", region)
      self.cloudwatch_client = cloudwatch_resource.meta.client
      self.CLOUDWATCH_CONFIG_TYPE_TO_CONFIG_VARIABLE_REPLACE_FUNC: Dict[
          str, Callable
      ] = {
          CloudwatchConfigType.AGENT.value: self._replace_cwa_config_vars,
          CloudwatchConfigType.DASHBOARD.value: self._replace_dashboard_config_vars,
          CloudwatchConfigType.ALARM.value: self._load_config_file,
      }
      self.CLOUDWATCH_CONFIG_TYPE_TO_UPDATE_FUNC_HEAD_NODE: Dict[
          str, Callable
      ] = {
          CloudwatchConfigType.AGENT.value: self._restart_cloudwatch_agent,
          CloudwatchConfigType.DASHBOARD.value: self._put_cloudwatch_dashboard,
          CloudwatchConfigType.ALARM.value: self._put_cloudwatch_alarm,
      }
      self.CLOUDWATCH_CONFIG_TYPE_TO_UPDATE_FUNC_WORKER_NODE: Dict[
          str, Callable
      ] = {
          CloudwatchConfigType.AGENT.value: self._restart_cloudwatch_agent,
          CloudwatchConfigType.ALARM.value: self._put_cloudwatch_alarm,
      }
  
imports: import copy
  import hashlib
  import json
  import logging
  import os
  import time
  from enum import Enum
  from typing import Any, Callable, Dict, List, Union
  import botocore
  from ray.autoscaler._private.aws.utils import client_cache, resource_cache
  from ray.autoscaler.tags import NODE_KIND_HEAD, TAG_RAY_CLUSTER_NAME, TAG_RAY_NODE_KIND
label_desc: Use image node_id 1 to create a new CloudwatchHelper object  with example: obj = CloudwatchHelper(provider_config, node_id, cluster_name)