Support for "Expired Object Delete Marker" with CloudFormation
amazon-s3, aws-cloudformation
Solution
At the time of writing CloudFormation syntax doesn't have the option. Instead of using the original S3 `LifecycleConfiguration` they renamed the properties for CloudFormation purposes and forgot this particular one (and a couple of others).
A much better place to ask this question would be CloudFormation forums, where people working at AWS can actually notice and fix the problem by implementing the missing rule.
Example of another missing rule (`AbortIncompleteMultipartUpload`) that was asked about in the forums: https://forums.aws.amazon.com/thread.jspa?messageID=746212
As a workaround, one possible solution is to use CloudFormation Custom Resources which can be implemented using a Lambda function. The process is described at http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources-lambda.html
Problem
When creating an S3 Bucket with Versioning turned on how do you use CloudFormation to enable the lifecycle option to delete "Object Delete Markers" when there are no "Non Current" objects remaining. See Example 8 in the Examples of Lifecycle Configuration documentation that uses ExpiredObjectDeleteMarker: ``` <LifecycleConfiguration> <Rule> ... <Expiration> <ExpiredObjectDeleteMarker>true</ExpiredObjectDeleteMarker> </Expiration> <NoncurrentVersionExpiration> <NoncurrentDays>30</NoncurrentDays> </NoncurrentVersionExpiration> </Rule> </LifecycleConfiguration> ``` By setting the `ExpiredObjectDeleteMarker` element to true in the `Expiration` action, you direct Amazon S3 to remove expired object delete markers. Amazon S3 will remove an expired object delete marker no sooner than 48 hours after the object expired. This is achievable via the UI, however I cannot find reference to this support via CloudFormation: Amazon S3 Lifecycle Rule