title: Create new file in S3 using AWS lambda function
body: <p>I have a requirement that my lambda functions creates a new CSV file and uploads it after writing to it . I am using Python boto3 for this purpose</p>
  <pre><code>with open('mycsv.csv', 'w', newline ='') as f:
       thewriter = csv.writer(f)
       thewriter.writerow(['col1','col2','col3'])
       s3_client = boto3.client('s3')
      response = s3_client.upload_file('/tmp/' + mycsv.csv, 'my-bucket', 'myfoleder/'+mycsv.csv)
  </code></pre>
  <p>Note that the file 'mycsv.csv' does not exist already and I want to be able to create it on the fly as part of the lambda function. Is this even possible? I get the following error when the lambda is triggered</p>
  <pre><code>[Errno 30] Read-only file system: 'mycsv.csv'
  </code></pre>