use of com.amazonaws.services.s3.model.ServerSideEncryptionRule in project cloud-pipeline by epam.
the class S3Helper method enableBucketEncryption.
private void enableBucketEncryption(AmazonS3 s3client, String bucketName, String kmsDataEncryptionKeyId) {
SetBucketEncryptionRequest encryptionRequest = new SetBucketEncryptionRequest().withBucketName(bucketName).withServerSideEncryptionConfiguration(new ServerSideEncryptionConfiguration().withRules(new ServerSideEncryptionRule().withApplyServerSideEncryptionByDefault(new ServerSideEncryptionByDefault().withSSEAlgorithm(SSEAlgorithm.KMS).withKMSMasterKeyID(kmsDataEncryptionKeyId))));
s3client.setBucketEncryption(encryptionRequest);
}
Aggregations