0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

S3 アクセスを特定IPアドレスのみに制限する

Last updated at Posted at 2020-07-27

アクセス権限→バケットポリシーに以下を設定。※アクションは用途に合わせて変更してください

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AccessControl-From-IPaddress-001",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": [
                "s3:GetObjectVersion",
                "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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?