Skip to content

v2.5.0

Latest

Choose a tag to compare

@cloudposse-releaser cloudposse-releaser released this 18 Feb 19:08
c5440ee
fix: Enable ECR lifecycle policy overrides @jwadolowski (#305) ## what
  • Enable lifecycle policy overrides for the default ECR repository
  • Upgrade cloudposse/ecr/aws from v0.44.0 to v1.0.0 (minor code changes, despite major version bump)

why

The module deploys an ECR repository by default using the cloudposse/ecr/aws module. It comes with a predefined ECR lifecycle policy that cannot be modified. This PR adds an ability to disable the default policy and replace it with your own (ECR identifiers are already exported and can be referenced in a aws_ecr_lifecycle_policy resource).

Note that only one aws_ecr_lifecycle_policy resource can be used with a given ECR repository.

Even though cloudposse/ecr/aws allows for extensive lifecycle customizations, it doesn't make sense to expose all of its variables in the ECS web app module (that'd clutter the variables.tf file which is already quite long).

The pre-built ECR repository can obviously be entirely disabled (via ecr_enabled variable) and replaced by a separate cloudposse/ecr/aws module instance, but that's a really inconvenient solution for repositories that have already accumulated hundreds/thousands of images.

The default ECR lifecycle policy stays enabled for backward compatibility reasons.

references

N/A