forked from jalantechnologies/platform-aws-tf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecr.tf
28 lines (26 loc) · 713 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 = var.ecr_repository_name
repository_image_tag_mutability = "MUTABLE"
repository_read_access_arns = [module.eks.cluster_iam_role_arn]
repository_lifecycle_policy = jsonencode({
rules = [
{
rulePriority = 1,
description = "Keep last 30 images",
selection = {
tagStatus = "tagged",
tagPrefixList = ["v"],
countType = "imageCountMoreThan",
countNumber = 30
},
action = {
type = "expire"
}
}
]
})
}
output "ecr_repository_url" {
value = module.ecr.repository_url
}