So I have a bucket where are hosted front project and am using CloudFront. so I want to restrict access to the bucket. site must be visible only from current IP addresses. I searched and found that in the current bucket->permissions, there is a bucket policy. and the bucket policy must be something like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowTrustedIPs",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-project-dev/*",
"Condition": {
"IpAddress": {
"aws:SourceIp": "my-office-ip/32"
}
}
}
]
}
but when I added this policy site was blocked. Access Denied. but from my office ip it must be visible. but it was not. so I really don't understand what am doing wrong. I used aws docks example... Can someone help me, please...