forked from tlc-pack/ci-terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds some repositories to enable apache/tvm#10646. The main caveat with this approach (vs letting CI nodes create the repositories as necessary) is that new images require an interaction with the infra team, but this is probably fine since these are pretty rare (`ci_hexagon` is the only new one in the past several months).
- Loading branch information
Showing
4 changed files
with
88 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
resource "aws_ecr_repository" "ci_ecr" { | ||
for_each = var.ecr_repositories | ||
name = each.value | ||
image_tag_mutability = "IMMUTABLE" | ||
} | ||
|
||
resource "aws_ecr_lifecycle_policy" "ci_ecr_policy" { | ||
for_each = var.ecr_repositories | ||
name = each.value | ||
repository = aws_ecr_repository.ci_ecr.name | ||
|
||
policy = <<EOF | ||
{ | ||
"rules": [ | ||
{ | ||
"rules": [ | ||
{ | ||
"action": { | ||
"type": "expire" | ||
}, | ||
"selection": { | ||
"countType": "sinceImagePushed", | ||
"countUnit": "days", | ||
"countNumber": 7, | ||
"tagStatus": "tagged", | ||
"tagPrefixList": [ | ||
"PR-" | ||
] | ||
}, | ||
"description": "Remove PR images", | ||
"rulePriority": 1 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
EOF | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters