Search in sources :

Example 1 with ServerSideEncryptionConfiguration

use of com.amazonaws.services.s3.model.ServerSideEncryptionConfiguration 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);
}
Also used : ServerSideEncryptionRule(com.amazonaws.services.s3.model.ServerSideEncryptionRule) ServerSideEncryptionByDefault(com.amazonaws.services.s3.model.ServerSideEncryptionByDefault) ServerSideEncryptionConfiguration(com.amazonaws.services.s3.model.ServerSideEncryptionConfiguration) SetBucketEncryptionRequest(com.amazonaws.services.s3.model.SetBucketEncryptionRequest)

Aggregations

ServerSideEncryptionByDefault (com.amazonaws.services.s3.model.ServerSideEncryptionByDefault)1 ServerSideEncryptionConfiguration (com.amazonaws.services.s3.model.ServerSideEncryptionConfiguration)1 ServerSideEncryptionRule (com.amazonaws.services.s3.model.ServerSideEncryptionRule)1 SetBucketEncryptionRequest (com.amazonaws.services.s3.model.SetBucketEncryptionRequest)1