Skip to content

Commit 6a3a79a

Browse files
authored
feat: forms app legacy ECR (#957)
1 parent 5cd34ff commit 6a3a79a

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

aws/ecr/ecr.tf

+31
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,37 @@ data "aws_iam_policy_document" "ecr_cross_account_read" {
155155
identifiers = ["lambda.amazonaws.com"]
156156
}
157157
}
158+
}
159+
160+
#
161+
# Holds the Forms app images used by the Rainbow deployment service
162+
#
163+
resource "aws_ecr_repository" "forms_app_legacy_repository" {
164+
name = "forms_app_legacy"
165+
image_tag_mutability = "MUTABLE"
158166

167+
image_scanning_configuration {
168+
scan_on_push = true
169+
}
159170
}
160171

172+
resource "aws_ecr_lifecycle_policy" "forms_app_legacy_policy" {
173+
repository = aws_ecr_repository.forms_app_legacy_repository.name
174+
policy = jsonencode({
175+
rules = [{
176+
rulePriority = 1
177+
description = "Keep last 30 images"
178+
179+
selection = {
180+
tagStatus = "tagged"
181+
tagPrefixList = ["v"]
182+
countType = "imageCountMoreThan"
183+
countNumber = 30
184+
}
185+
186+
action = {
187+
type = "expire"
188+
}
189+
}]
190+
})
191+
}

0 commit comments

Comments
 (0)