Created
February 19, 2022 08:16
-
-
Save dev-daeun/b4589ee2a49a0acc6cd12af05eb94f9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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