Provide AWS KMS key when doing MultiPartUpload with S3 TransferManager

264 views Asked by At

I am currently trying to use AWS S3 TransferManager to upload a file greater than 5GB to S3, since S3 requires multi part upload for files greater than 5GB.

I am using the following code to do this:

TransferManager tm = TransferManagerBuilder.standard().withS3Client(s3Client).build();
Upload up = tm.upload(bucketName, bucketKey, localfile);
up.waitForCompletion();

This achieves the behavior that I want, but I want to provide a KMS key to encrypt the file while uploading it to S3. Previously, I was using the PutObject API provided by S3 to do the uploads.

putObject(s3Client, bucketName, bucketKey, localFile, kmsKeyId)

How do I achieve the same behavior as putObject above with the transferManager upload?

0

There are 0 answers