On AWS Image Builder I've created a lifecycle policy stating to remove older than 6 months resources, retaining latest 2, all of which tagged.
PolicyDetails:
- Action:
IncludeResources:
Amis: True
Snapshots: True
Type: DELETE
Filter:
RetainAtLeast: 2
Type: AGE
Unit: MONTHS
Value: 6
ResourceSelection:
TagMap:
"CreatedBy": "EC2 Image Builder"
However any image/AMI/snapshot older than 6 months are not removed. The action logs shows no impacted resources. All AMIs and snapshots have the tag as defined above.