Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions ops/modules/ecr/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,31 @@ resource "aws_ecr_lifecycle_policy" "mark_admin" {
}]
})
}

resource "aws_ecr_repository" "mark_handler" {
name = "mark-handler"
image_tag_mutability = "MUTABLE"

image_scanning_configuration {
scan_on_push = true
}
}

resource "aws_ecr_lifecycle_policy" "mark_handler" {
repository = aws_ecr_repository.mark_handler.name

policy = jsonencode({
rules = [{
rulePriority = 1
description = "Keep last 30 images"
selection = {
tagStatus = "any"
countType = "imageCountMoreThan"
countNumber = 30
}
action = {
type = "expire"
}
}]
})
}
5 changes: 5 additions & 0 deletions ops/modules/ecr/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ output "mark_poller_repository_url" {
output "mark_admin_repository_url" {
description = "URL of the Mark Admin API ECR repository"
value = aws_ecr_repository.mark_admin.repository_url
}

output "mark_handler_repository_url" {
description = "URL of the Mark Handler ECR repository"
value = aws_ecr_repository.mark_handler.repository_url
}