Skip to content

Commit

Permalink
Make image count configurable. (#103)
Browse files Browse the repository at this point in the history
* Make image count configurable.

* Add new line.
  • Loading branch information
vincentwschau authored Jun 4, 2024
1 parent 0f2d2a0 commit 06d9ca6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions indexer/ecr.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ resource "aws_ecr_lifecycle_policy" "main" {
policy = jsonencode({
rules = [{
rulePriority = 1
description = "keep last 100 images"
description = "keep last ${var.image_count} images"
action = {
type = "expire"
}
selection = {
tagStatus = "any"
countType = "imageCountMoreThan"
countNumber = 100
countNumber = var.image_count
}
}]
})
Expand Down Expand Up @@ -58,14 +58,14 @@ resource "aws_ecr_lifecycle_policy" "lambda_services" {
policy = jsonencode({
rules = [{
rulePriority = 1
description = "keep last 100 images"
description = "keep last ${var.image_count} images"
action = {
type = "expire"
}
selection = {
tagStatus = "any"
countType = "imageCountMoreThan"
countNumber = 100
countNumber = var.image_count
}
}]
})
Expand Down
6 changes: 6 additions & 0 deletions indexer/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -466,3 +466,9 @@ variable "public_access" {
description = "Enables public access of the indexer endpoints."
default = true
}

variable "image_count" {
type = number
description = "Number of images to store for ECR, defaults to 100."
default = 100
}

0 comments on commit 06d9ca6

Please sign in to comment.