aws / aws/aws-sdk-java-v2

S3 SDK: S3CopyObjectOperation does not allow setting SSE-S3

Open
#1,868 3 comments 0 reactions 0 assignees View on GitHub
service-api service:s3
Dominant language
Java
Stars
2.6k
Forks
1k
Avg merge
2d 9h
Merged PRs (30d)
51

Description

It's not currently possible to enable [SSE-S3](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) as part of an S3CopyObjectOperation. There only appears to be support for [SSE-KMS](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) via the `.sseAwsKmsKeyId()` method on the builder.

## Describe the Feature
Add the ability to specify SSE-S3 as part of an S3CopyObjectOperation.

## Is your Feature Request related to a problem?
I want to programmatically encrypt all existing objects within a bucket and remove unencrypted versions of the objects, before enabling default encryption on the bucket and applying an "encryption only" policy, to ensure that nothing in the bucket is not encrypted at rest.

## Proposed Solution
Provide a new `.enableSSES3()` method on the builder.

## Describe alternatives you've considered
One-by-one copy of the latest version of each object.

## Additional Context

I'm currently using v1 of the SDK and hit this problem https://github.com/aws/aws-sdk-java/issues/1301 so tried out v2 of the SDK which still didn't solve my problem.

- [ ] I may be able to implement this feature request

## Your Environment

* AWS Java SDK version used: 2.13.26
* JDK version used: 1.8.0_252
* Operating System and version: macOS 10.15.5

Contributor guide

Open the contributing guide

Research direction

Start at S3CopyObjectOperation and its builder, then trace the existing sseAwsKmsKeyId() path to understand how copy encryption options reach S3. Add the requested enableSSES3() capability and verify that a copy operation sends the SSE-S3 setting; the issue names no test, so identify the relevant operation or builder tests before running them.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java
Domain
backend, cloud
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.