Providing lifecycle rules for ECR repositories

Our costs for ECR storage are starting to go up and I noticed that when using the Docker image feature of Serverless Framework there seems to be no lifecycle management policy. Is it possible to set one? Could I write some custom CloudFormation XML that refers to the repository created by the Serverless Framework?