{{ }} Substitute variables
Adjust the variable values according to your preference.
Policy Code
Referenced from: https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policy-examples.html
1{
2 "Version": "2012-10-17",
3 "Id": "PermitOnlyIPRange",
4 "Statement": [
5 {
6 "Sid": "Deny not in this range",
7 "Effect": "Deny",
8 "Principal": "*",
9 "Action": "ecr:*",
10 "Condition": {
11 "NotIpAddress": {
12 "aws:SourceIp": "54.240.143.0/24"
13 }
14 }
15 }
16 ]
17}