Skip to content

Instantly share code, notes, and snippets.

@dev-daeun
Created February 19, 2022 08:16
Show Gist options
  • Save dev-daeun/b4589ee2a49a0acc6cd12af05eb94f9b to your computer and use it in GitHub Desktop.
Save dev-daeun/b4589ee2a49a0acc6cd12af05eb94f9b to your computer and use it in GitHub Desktop.
resource "aws_ecr_repository_policy" "ecr-policy" {
repository = aws_ecr_repository.ecr-repo.name
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Sid = "ECRRepositoryPolicy",
Effect = "Deny",
Principal = {
AWS = "${aws_iam_user.ecr-user.arn}"
},
Action = [
"ecr:BatchDeleteImage"
]
}
]
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment