Skip to content

Commit e1cee7e

Browse files
committed
added scan variable
1 parent e168e56 commit e1cee7e

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ resource "aws_ecr_repository" "default" {
2828
count = var.enabled_ecr ? 1 : 0
2929
name = module.labels.id
3030
tags = module.labels.tags
31+
image_tag_mutability = var.image_tag_mutability
32+
33+
image_scanning_configuration {
34+
scan_on_push = var.scan_on_push
35+
}
3136
}
3237

3338
resource "aws_ecr_lifecycle_policy" "default" {

variables.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,15 @@ variable "principals_full_access" {
7676
type = list
7777
description = "Principal ARN to provide with full access to the ECR."
7878
default = []
79+
}
80+
81+
variable "image_tag_mutability" {
82+
type = string
83+
default = "MUTABLE"
84+
description = "The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE."
85+
}
86+
variable "scan_on_push" {
87+
type = bool
88+
description = "Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false)."
89+
default = true
7990
}

0 commit comments

Comments
 (0)