title: Writing json to file in s3 bucket
body: <p>This code writes json to a file in s3,
  what i wanted to achieve is instead of opening data.json file and writing to s3 (sample.json) file, </p>
  
  <p>how do i pass the json directly and write to a file in s3 ?</p>
  
  <pre><code>import boto3
  
  s3 = boto3.resource('s3', aws_access_key_id='aws_key', aws_secret_access_key='aws_sec_key')
  s3.Object('mybucket', 'sample.json').put(Body=open('data.json', 'rb'))
  </code></pre>