Search in sources :

Example 1 with DeleteBucketLifecycleRequest

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);
    }
}
Also used : S3Exception(software.amazon.awssdk.services.s3.model.S3Exception) DeleteBucketLifecycleRequest(software.amazon.awssdk.services.s3.model.DeleteBucketLifecycleRequest)

Aggregations

DeleteBucketLifecycleRequest (software.amazon.awssdk.services.s3.model.DeleteBucketLifecycleRequest)1 S3Exception (software.amazon.awssdk.services.s3.model.S3Exception)1