I'm beginner to aws cdk, I have implemented S3 lifecycle management using AWS CDK to delete bucket (including files) after 10 days of bucket creation.
Cdk implementation as below:
Builder builder = BucketProps.builder().encryption(BucketEncryption.KMS_MANAGED).removalPolicy(RemovalPolicy.DESTROY);
final String bucketName = ApplicationProperties.INSTANCE.getBatchS3Name();
final List<LifecycleRule> lifecycleRules = new ArrayList();
final LifecycleRule rule = new LifecycleRule.Builder().expiration(Duration.days(10)).build();
lifecycleRules.add(rule);
builder.lifecycleRules(lifecycleRules);
this.bucket = new Bucket(stack, "BatchWorkBucket", builder.build());
But s3 object is not getting deleted after 10 days. It is getting expired as shown in attached image. We don't have option to setup "Delete expired delete markers or incomplete multipart uploads" or other options in cdk api (https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.LifecycleRule.html#transitions).
Could you please help me on this subject, how to delete s3 object using aws cdk.