Skip to content

Commit

Permalink
added scan variable
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolnagpal committed Feb 17, 2021
1 parent e168e56 commit e1cee7e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ resource "aws_ecr_repository" "default" {
count = var.enabled_ecr ? 1 : 0
name = module.labels.id
tags = module.labels.tags
image_tag_mutability = var.image_tag_mutability

image_scanning_configuration {
scan_on_push = var.scan_on_push
}
}

resource "aws_ecr_lifecycle_policy" "default" {
Expand Down
11 changes: 11 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,15 @@ variable "principals_full_access" {
type = list
description = "Principal ARN to provide with full access to the ECR."
default = []
}

variable "image_tag_mutability" {
type = string
default = "MUTABLE"
description = "The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE."
}
variable "scan_on_push" {
type = bool
description = "Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false)."
default = true
}

0 comments on commit e1cee7e

Please sign in to comment.