code: def kms_encrypt(value, key, aws_config=None):
      
      aws_config = aws_config or {}
      aws = boto3.session.Session(**aws_config)
      client = aws.client('kms')
      enc_res = client.encrypt(KeyId=key,
                               Plaintext=value)
      return n(b64encode(enc_res['CiphertextBlob']))
docs: Encrypt and value with KMS key.
  
      Args:
          value (str): value to encrypt
          key (str): key id or alias
          aws_config (optional[dict]): aws credentials
              dict of arguments passed into boto3 session
              example:
                  aws_creds = {'aws_access_key_id': aws_access_key_id,
                               'aws_secret_access_key': aws_secret_access_key,
                               'region_name': 'us-east-1'}
  
      Returns:
          str: encrypted cipher text