You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per Code in this file(s3-bucket-helper.ts) from line 70, S3 bucket which has a lifecycle rule cannot be used on logging bucket according to code, because according to the code LifecycleConfiguration Rules are getting removed since because of this whatever LifecycleRules we are defining in the loggingBucketProps are getting removed.
I also replicated same scenario on my end. Replication steps:
I observed the behaviour in which, no CDK difference after updating the lifecycleRule to logging bucket.
In an attempt to resolve the issue, I tried to attach the lifecycle policy to the logging bucket explicitly using addLifecycleRule() method[1] as mentioned in the below code:
Unfortunately, this too did not help me and I observed same behavior again. After analyzing the back-end code, I found that natively the logging bucket that's being created by 'aws-eventbridge-kinesisfirehose-s3' construct cannot have a lifecycle rule since in the line 70 of the repository LifecycleConfiguration Rules property is being removed from here.
To override this behavior, I used escape hatching concept to get an object of CfnBucket class and set the addOverride method as shown below:
Thanks for the input. It appears to us that the line of code removing lifecycle rules from the logging bucket is no longer appropriate (Perhaps it was never appropriate). We'll remove that line so that the lifecycle rules you specify in props will not be removed. We'll also expose existingLoggingBucket in the construct props for aws-eventbridge-kinesisfirehose-s3 so that clients can supply their own logging bucket. No ETA at this time - but it has a high priority for us (the timeframe won't be months).
https://github.com/awslabs/aws-solutions-constructs/blob/8ca5242530716c6401a3749ad2187f266e26cf4d/source/patterns/%40aws-solutions-constructs/core/lib/s3-bucket-helper.ts#LL64C1-L70C85
As per Code in this file(s3-bucket-helper.ts) from line 70, S3 bucket which has a lifecycle rule cannot be used on logging bucket according to code, because according to the code LifecycleConfiguration Rules are getting removed since because of this whatever LifecycleRules we are defining in the loggingBucketProps are getting removed.
I also replicated same scenario on my end. Replication steps:
I observed the behaviour in which, no CDK difference after updating the lifecycleRule to logging bucket.
In an attempt to resolve the issue, I tried to attach the lifecycle policy to the logging bucket explicitly using addLifecycleRule() method[1] as mentioned in the below code:
Unfortunately, this too did not help me and I observed same behavior again. After analyzing the back-end code, I found that natively the logging bucket that's being created by 'aws-eventbridge-kinesisfirehose-s3' construct cannot have a lifecycle rule since in the line 70 of the repository LifecycleConfiguration Rules property is being removed from here.
Expection:
As a feature request, Please consider lifecycle rules props for logging bucket as well.
The text was updated successfully, but these errors were encountered: