-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecr.tf
42 lines (32 loc) · 1.04 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
################################################################################
# ECR Repository
################################################################################
module "ecr_disabled" {
source = "git::https://github.com/terraform-aws-modules/terraform-aws-ecr.git"
create = false
}
module "ecr" {
source = "git::https://github.com/terraform-aws-modules/terraform-aws-ecr.git"
repository_name = "ai"
repository_type = "private"
repository_read_write_access_arns = [data.aws_caller_identity.current.arn]
repository_force_delete = true
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"
}
}
]
})
}