use of com.amazonaws.services.s3.model.BucketVersioningConfiguration in project aws-doc-sdk-examples by awsdocs.
the class CrossRegionReplication method createBucket.
private static void createBucket(AmazonS3 s3Client, Regions region, String bucketName) {
CreateBucketRequest request = new CreateBucketRequest(bucketName, region.getName());
s3Client.createBucket(request);
BucketVersioningConfiguration configuration = new BucketVersioningConfiguration().withStatus(BucketVersioningConfiguration.ENABLED);
SetBucketVersioningConfigurationRequest enableVersioningRequest = new SetBucketVersioningConfigurationRequest(bucketName, configuration);
s3Client.setBucketVersioningConfiguration(enableVersioningRequest);
}
Aggregations