class_docstr: Loads credentials that are housed on AWS SSM, or cached locally.
  
  Helper service to OutputDispatcher.
  
  OutputDispatcher implementations may require credentials to authenticate with an external
  gateway. All credentials for OutputDispatchers are to be stored in a single parameter in AWS SSM
  and are encrypted with AWS KMS. When alerts are dispatched via OutputDispatchers, these
  encrypted credentials are downloaded and cached locally on the filesystem. Then, AWS KMS is
  used to decrypt the credentials when in use.
  
  Public methods:
      load_credentials: Returns a dict of the credentials requested
      get_local_credentials_temp_dir(): Returns full path to a temporary directory where all
          encrypted credentials are cached.
class_docstr_tok: ["Loads","credentials","that","are","housed","on","AWS","SSM",",","or","cached","locally",".","Helper","service","to","OutputDispatcher",".","OutputDispatcher","implementations","may","require","credentials","to","authenticate","with","an","external","gateway",".","All","credentials","for","OutputDispatchers","are","to","be","stored","in","a","single","parameter","in","AWS","SSM","and","are","encrypted","with","AWS","KMS",".","When","alerts","are","dispatched","via","OutputDispatchers",",","these","encrypted","credentials","are","downloaded","and","cached","locally","on","the","filesystem",".","Then",",","AWS","KMS","is","used","to","decrypt","the","credentials","when","in","use",".","Public","methods",":","load_credentials",":","Returns","a","dict","of","the","credentials","requested","get_local_credentials_temp_dir","(",")",":","Returns","full","path","to","a","temporary","directory","where","all","encrypted","credentials","are","cached","."]
code: def __init__(
      self,
      service_name,
      config=None,
      defaults=None,
      region=None,
      prefix=None,
      aws_account_id=None,
  ):
      self._service_name = service_name
  
      # Region: Check constructor args first, then config
      self._region = (
          config["global"]["account"]["region"]
          if region is None
          else region
      )
  
      # Prefix: Check constructor args first, then ENV, then config
      self._prefix = self._calculate_prefix(prefix, config)
  
      # Account Id: Check constructor args first, then ENV, then config
      self._account_id = self._calculate_account_id(
          aws_account_id, config
      )
  
      self._defaults = defaults if defaults else {}
  
      # Drivers are strategies utilized by this class for fetching credentials from various
      # locations on disk or remotely
      self._drivers = []  # type: list[CredentialsProvidingDriver]
      self._core_driver = None  # type: SSMDriver
      self._setup_drivers()
  
imports: import json
  import os
  import shutil
  import tempfile
  from abc import abstractmethod
  from botocore.exceptions import ClientError
  from streamalert.shared.helpers.aws_api_client import AwsKms, AwsSsm
  from streamalert.shared.logger import get_logger
label_desc: Use image node_id 1 to create a new OutputCredentialsProvider object  with example: obj = OutputCredentialsProvider(service_name, config, defaults, region, prefix, aws_account_id)