Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Image tagging method cannot be used with container repository lifecycle policies #38

@jinty

Description

@jinty

I am trying to setup a stack using you method of tagging images but adding in a container lifecycle policy on the repository to delete old images. Most images get tags so in order to delete them I am required to add a "tagPrefixList". adding a tag prefix list ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"] causes an "Internal Server Error" and timeout in cloudformation...

Here's a excerpt from my .yaml file:

ContainerRepository:
    Type: "AWS::ECR::Repository"
    Properties:
      RepositoryName: test-repository
      LifecyclePolicy:
        LifecyclePolicyText: |
          {
              "rules": [
                  {
                      "rulePriority": 1,
                      "description": "Keep only 20 untagged image, expire all others",
                      "selection": {
                          "tagStatus": "untagged",
                          "countType": "imageCountMoreThan",
                          "countNumber": 20
                      },
                      "action": {
                          "type": "expire"
                      }
                  },
                  {
                      "rulePriority": 2,
                      "description": "Keep only 20 tagged image, expire all others",
                      "selection": {
                          "tagStatus": "tagged",
                          "tagPrefixList": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"],
                          "countType": "imageCountMoreThan",
                          "countNumber": 20
                      },
                      "action": {
                          "type": "expire"
                      }
                  }
              ]
          }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions