I am trying to control access to my files in s3 using cloudfront distribution with limited viewer access using signed URLs, I generate the signed url with custom policy to control the access using source ip, everything works without including the condition for the ip, when I add the condition for source IP I get access denied, since it works fine without this condition I know the issue is with this specific condition.
I tried to use all for IP source:
0.0.0.0/0
but still the same, here is my custom policy,
val policy: String = "{\"Statement\": [{\"Resource\":\"https://[url to my resource in cloudfront distribution ]\",\"Condition\":{\"DateLessThan\":{\"AWS:EpochTime\":1743036324},\"IpAddress\":{\"AWS:SourceIp\":\"0.0.0.0/0\"}}}]}"
If I remove the limited viewer access I can access the resource, any help would be appreciated.