Skip to content

Commit

Permalink
sec: apply security practices to ecr module
Browse files Browse the repository at this point in the history
  • Loading branch information
josephgoksu committed May 31, 2023
1 parent b47c684 commit 382d1b1
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion modules/ecr/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# Create an ECR repository named "my-ecr-repo"
# Create an ECR repository named <project_name>-ecr-repo
resource "aws_ecr_repository" "ecr_repo" {
# Name of the ECR repository
name = "${var.project_name}-ecr-repo"

# Set the image tag mutability to immutable
image_tag_mutability = "IMMUTABLE"

# Enable image scanning on push
image_scanning_configuration {
scan_on_push = true
}

# Add tags to the ECR repository
tags = {
Name = "${var.project_name}-ecr-repo"
}
}

0 comments on commit 382d1b1

Please sign in to comment.