diff --git a/copy_images.tf b/copy_images.tf index e35264a..7a7801c 100644 --- a/copy_images.tf +++ b/copy_images.tf @@ -75,7 +75,7 @@ locals { } module "images" { - source = "git@github.e.it.census.gov:terraform-modules/aws-ecr-copy-images.git/?ref=2.0.2" + source = "git@github.e.it.census.gov:terraform-modules/aws-ecr-copy-images.git/?ref=tf-upgrade" profile = var.profile application_name = var.cluster_name @@ -91,4 +91,22 @@ module "images" { ## region = "" ## source_password = "" ## source_username = "" + + enable_lifecycle_policy = true + lifecycle_policy_all = true + + data "aws_ecr_lifecycle_policy_document" "pushed" { + rule { + priority = 1 + description = "keep images tagged test, last push 28 days ago" + + selection { + tag_status = "tagged" + # tag_pattern_list = ["*test*"] + count_type = "sinceImagePushed" + count_number = 28 + count_unit = days + } + } + } } diff --git a/variables.tf b/variables.tf index 19947a4..b488133 100644 --- a/variables.tf +++ b/variables.tf @@ -49,34 +49,6 @@ variable "rwo_storage_class" { default = "gp3-encrypted" } -# variable "table_manager_retention_deletes_enabled" { -# description = "" -# type = string -# default = "false" -# } - -# variable "table_manager_retention_period" { -# description = "Loki defaults to 0" -# type = string -# default = "2160h" -# } - -# variable "kubectl_image_registry" { -# description = "The registry holding the kubectl docker image" -# type = string -# } - -# variable "kubectl_image_repository" { -# description = "The image repository holding the kubectl docker image" -# type = string -# } - -# variable "kubectl_image_tag" { -# description = "The image tag to use to access the kubectl docker image" -# type = string -# } - - # helm add repo grafana "https://grafana.github.io/helm-charts" # helm search repo grafana/loki variable "loki_chart_version" {