title: aws firehose lambda function invocation gives wrong output strcuture format
body: <p>When  i insert a data object to aws firhose stream using a put operation it works fine .As lambda function is enabled on my firehose stream .hence a lambda function is invoked but  gives me a output structure response error :</p>
  
  <pre><code>"errorMessage":"Invalid output structure: Please check your function and make sure the processed records contain valid result status of Dropped, Ok, or ProcessingFailed."
  </code></pre>
  
  <p>so now i have created my lambda function like this way  to make the correct output strcuture :</p>
  
  <pre><code>import base64
  import json
  
  print('Loading function')
  
  def lambda_handler(event, context):
      output=[]
      print('event'+str(event))
      for record in event['records']:
          payload = base64.b64decode(record['data'])
          print('payload'+str(payload))
          payload=base64.b64encode(payload)
          output_record={
              'recordId':record['recordId'],
              'result': 'Ok',
               'data':  base64.b64encode(json.dumps('hello'))
          }
      output.append(output_record)
      return { 'records': output }
  </code></pre>
  
  <p>Now i am getting the follwing eror on encoding the 'data' field as </p>
  
  <pre><code>"errorMessage": "a bytes-like object is required, not 'str'",
  </code></pre>
  
  <p>and if i change the 'hello' to bytes  like b'hello' then i get the following error  :</p>
  
  <pre><code> "errorMessage": "Object of type bytes is not JSON serializable",
  </code></pre>