use of software.amazon.awssdk.services.s3.model.DeleteBucketLifecycleRequest in project aws-doc-sdk-examples by awsdocs.
the class LifecycleConfiguration method deleteLifecycleConfig.
// Delete the configuration from the Amazon S3 bucket.
public static void deleteLifecycleConfig(S3Client s3, String bucketName, String accountId) {
try {
DeleteBucketLifecycleRequest deleteBucketLifecycleRequest = DeleteBucketLifecycleRequest.builder().bucket(bucketName).expectedBucketOwner(accountId).build();
s3.deleteBucketLifecycle(deleteBucketLifecycleRequest);
} catch (S3Exception e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}
Aggregations