/** * Amazon ECR Repository for Clawdbot Container Images */ resource "aws_ecr_repository" "clawdbot" { name = "${var.project_name}/bot" image_tag_mutability = "MUTABLE" image_scanning_configuration { scan_on_push = true } tags = { Name = "${var.project_name}-ecr" } } # ECR Lifecycle Policy (keep last 10 images) resource "aws_ecr_lifecycle_policy" "clawdbot" { repository = aws_ecr_repository.clawdbot.name policy = jsonencode({ rules = [{ rulePriority = 1 description = "Keep last 10 images" selection = { tagStatus = "any" countType = "imageCountMoreThan" countNumber = 10 } action = { type = "expire" } }] }) }