LoginSignup
0
0

More than 3 years have passed since last update.

S3に画像アップロードして特定IPだけアクセス可能にする

Last updated at Posted at 2021-04-03
  1. Bucket作成
  2. アクセ師制御ページを開く; 対象バケット > アクセス許可
  3. ブロックパブリックアクセス > 任意のパブリックバケットポリシーまたは〜 をオフにする
  4. バケットポリシーを編集
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AddPerm",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::${バケット名}/*",
            "Condition": {
                "IpAddress": {
                    "aws:SourceIp": "${対象のIPアドレス}"
                }
            }
        }
    ]
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0