cloudposse / terraform-aws-ecr

Terraform Module to manage Docker Container Registries on AWS ECR
https://cloudposse.com/accelerate
Apache License 2.0
185 stars 133 forks source link

Way to have "wildcard matching" tags also be posible to use in protected_tags #133

Closed mrdntgrn closed 3 months ago

mrdntgrn commented 3 months ago

Describe the Feature

Support of wildcard matching protected tags

Expected Behavior

Right now the protected_tags variable allows to have list of image tags prefixes(like "prod" or "live") and no way to have "wildcard matching" protected tags, like semver format(*.*.*) or "*prod"

Use Case

There are cases when the protected tag is not just a prefixed ones("prod" or "live"), for example when the tags are dynamicaly generated based on smversion(like "2.0.1" or "1.0.0-alpha") or cases when we need to protect tags in wildcard format "prod" or "live"

Describe Ideal Solution

It will be great to allow to have wildcard matching terms/strings(like "*prod") be used in protected_tags list variable, for example the following value for protected_tags variable be acceptable and wildcard ones be trated as wildcard match and non wildcard ones as prefix match:

["prod", "*prod", "*.*.*"]

Alternatives Considered

No response

Additional Context

No response