Large Uploads to SSE-KMS Buckets
Why multipart uploads to an SSE-KMS bucket fail with access denied, and the exact KMS permissions the uploader needs.
The decision: why does a large upload to an SSE-KMS bucket fail while small ones succeed, and which KMS permissions fix it?
The AWS CLI and SDKs switch to multipart upload automatically for big files. When the bucket encrypts with SSE-KMS, the uploading principal needs KMS permissions in addition to S3 permissions. Missing KMS rights is the classic cause of an Access Denied on large files while small files work.
Permissions
| API call | KMS action needed by the requester |
|---|---|
| CreateMultipartUpload | kms:GenerateDataKey |
| UploadPart and UploadPartCopy | kms:Decrypt |
| CompleteMultipartUpload | kms:Decrypt (without it the object is created with no checksum value) |
Grant both kms:Decrypt and kms:GenerateDataKey* on the key. Same account as the key: make sure both the IAM policy and the key policy allow it. Cross-account: the key policy of the key owner account and the caller's IAM policy must both allow it.
Core facts
- Use multipart upload for objects of 100 MB or more. Part numbers run from 1 to 10,000.
- A KMS key encrypts at most 4 KB directly. For larger data S3 uses envelope encryption with a data key, handled for you in SSE-KMS.
- S3 must decrypt stored parts to assemble them, which is why
kms:Decryptis needed. - Unfinished uploads keep billing for stored parts. Add a lifecycle rule using
AbortIncompleteMultipartUpload.
Exam signal
Small files upload, large files fail, and the bucket uses a customer managed KMS key: add kms:Decrypt and kms:GenerateDataKey for the uploader.