-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathecr.tf
More file actions
42 lines (37 loc) · 967 Bytes
/
ecr.tf
File metadata and controls
42 lines (37 loc) · 967 Bytes
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 for VeraSlack Container Images
resource "aws_ecr_repository" "veraslack" {
name = local.ecr_repository_name
image_tag_mutability = "MUTABLE"
image_scanning_configuration {
scan_on_push = true
}
encryption_configuration {
encryption_type = "AES256"
}
tags = {
Name = local.ecr_repository_name
Environment = var.environment
ManagedBy = "Terraform"
Purpose = "Container images for Vera AgentCore runtime"
}
}
# ECR Lifecycle Policy - Keep last 10 images
resource "aws_ecr_lifecycle_policy" "veraslack" {
repository = aws_ecr_repository.veraslack.name
policy = jsonencode({
rules = [
{
rulePriority = 1
description = "Keep last 10 images"
selection = {
tagStatus = "any"
countType = "imageCountMoreThan"
countNumber = 10
}
action = {
type = "expire"
}
}
]
})
}