code: def _get_secret_from_vault(
          key, environment=None, stage=None, namespace=None,
          wait_exponential_multiplier=50, wait_exponential_max=5000,
          stop_max_delay=10000):
      
      # Get the encrypted secret from DynamoDB
      table_name = _secrets_table_name(environment=environment, stage=stage)
  
      if namespace:
          key = "{}:{}".format(namespace, key)
  
      if table_name is None:
          logger.warning("Can't produce secrets table name: unable to retrieve "
                         "secret '{}'".format(key))
          return
  
      client = boto3.client('dynamodb')
      logger.info("Retriving key '{}' from table '{}'".format(
          key, table_name))
  
      @retry(retry_on_exception=_is_critical_exception,
             wait_exponential_multiplier=wait_exponential_multiplier,
             wait_exponential_max=wait_exponential_max,
             stop_max_delay=stop_max_delay)
      def get_item():
          try:
              return client.get_item(
                  TableName=table_name,
                  Key={'id': {'S': key}}).get('Item', {}).get(
                      'value', {}).get('B')
          except Exception as err:
              if _is_dynamodb_critical_exception(err):
                  raise CriticalError(err)
              else:
                  raise
  
      encrypted = get_item()
  
      if encrypted is None:
          return
  
      # Decrypt using KMS
      client = boto3.client('kms')
      try:
          value = client.decrypt(CiphertextBlob=encrypted)['Plaintext'].decode()
      except ClientError:
          logger.error("KMS error when trying to decrypt secret")
          traceback.print_exc()
          return
  
      try:
          value = json.loads(value)
      except (TypeError, ValueError):
          # It's ok, the client should know how to deal with the value
          pass
  
      return value
docs: Retrieves a secret from the secrets vault.