How do I set the S3 bucket policy so that it can only be accessed by the specified IP
May 23, 2019
0x00 TL;DR
This document records how to set up the S3 bucket policy so that it can only be accessed by the specified IP.
Set the bucket policy to deny the operation except for the specified IP.
0x01 Policy
1 | { |
If you use this policy, you can access the S3 bucket only if the IP is 54.222.177.177.
Note: Please confirm that the specified IP is a static IP,If you use dynamic IP, there is a risk that the S3 bucket will not be accessible when the IP is changed.if unfortunately, you need to contact the AWS Support revocation policy.