title: How to add encryption to boto3.s3.transfer.TransferConfig for s3 file upload
body: <p>I am trying to upload a file to s3 using boto3 file_upload method. This is pretty straight forward until server side encryption is needed. In the past I have used put_object to achieve this. </p>
  
  <p>Like so:</p>
  
  <pre><code>import boto3
  s3 = boto3.resource('s3')
  s3.Bucket(bucket).put_object(Key=object_name,
                               Body=data,
                               ServerSideEncryption='aws:kms',
                               SSEKMSKeyId='alias/aws/s3')
  </code></pre>
  
  <p>I now want to upload files directly to s3 using the file_upload method. I can't find how to add server side encryption to the file_upload method. The file_upload method can take a <a href="http://boto3.readthedocs.io/en/latest/reference/customizations/s3.html#boto3.s3.transfer.TransferConfig" rel="noreferrer">TransferConfig</a> but I do not see any arguments that set the encryption but I do see them in <a href="http://boto3.readthedocs.io/en/latest/reference/customizations/s3.html#boto3.s3.transfer.S3Transfer" rel="noreferrer">S3Transfer</a>. </p>
  
  <p>I am looking for something like this:</p>
  
  <pre><code>import boto3
  s3 = boto3.resource('s3')
  tc = boto3.s3.transfer.TransferConfig(ServerSideEncryption='aws:kms',
                                        SEKMSKeyId='alias/aws/s3')
  s3.upload_file(file_name, 
                 bucket, 
                 object_name,
                 Config=tc)
  </code></pre>
  
  <p>boto3 documentation </p>
  
  <ul>
  <li><a href="http://boto3.readthedocs.io/en/latest/reference/services/s3.html#S3.Client.upload_file" rel="noreferrer">file_upload</a></li>
  <li><a href="http://boto3.readthedocs.io/en/latest/reference/customizations/s3.html#boto3.s3.transfer.TransferConfig" rel="noreferrer">TransferConfig</a></li>
  </ul>