I have in my repo a yaml file template.yaml
where I have the sam template that defines all the infrastructure for a lambda function in it and it works perfectly.
I wanted to add the following lifecycle policy
to keep only 200 images on ECR
AWSTemplateFormatVersion: "2010-09-09"
Resources:
ECRPolicy:
Type: AWS::ECR::Repository
Properties:
RepositoryName: repo-ecr
LifecyclePolicy:
LifecyclePolicyText: |
{
"rules": [
{
"rulePriority": 1,
"description": "Only keep 200 images",
"selection": {
"tagStatus": "any",
"countType": "imageCountMoreThan",
"countNumber": 200
},
"action": { "type": "expire" }
}]
}
After I published the changes I made to the yaml file, and the CI/CD is done building .. am I supposed to see the policy in the Amazon Elastic Container Registry -> Lifecycle policy? Because it's empty, and not sure how to test it. Any help/explanation is appreciated.