-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecr.tf
28 lines (27 loc) · 781 Bytes
/
ecr.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module "ecr" {
source = "terraform-aws-modules/ecr/aws"
repository_name = lower(local.name)
repository_image_tag_mutability = "MUTABLE"
repository_lifecycle_policy = jsonencode({
rules = [
{
rulePriority = 1,
description = "Keep last 30 images",
selection = {
tagStatus = "tagged",
tagPrefixList = ["v"],
countType = "imageCountMoreThan",
countNumber = 30
},
action = {
type = "expire"
}
}
]
})
# Registry Scanning Configuration
manage_registry_scanning_configuration = true
registry_scan_type = "BASIC"
repository_force_delete = true
tags = local.tags
}