amazon s3 – Can spring-cloud-aws using resourceLoader be used with S3 server-side-encryption using a kms key?
Using AWS SDK, it can be achieved easily like this:
PutObjectRequest putRequest =
new PutObjectRequest(bucket_name, bucket_name, new File(file_path))
.withSSEAwsKeyManagementParams(new SSEAwsKeyManagementParams("KMS-KEY"));
s3.putObject(putRequest);
However, can this is achieved using spring-cloud-aws with a s3 capable ResourceLoader as below ?
WritableResource resource = (WritableResource) resourceLoader
.getResource(s3Url);
try (OutputStream outputStream = resource.getOutputStream()) {
Files.copy(file.toPath(), outputStream);
}
Read more here: Source link