0
1

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バケットにのみアクセス可能なIAMを作成する

Last updated at Posted at 2021-07-06

ローカル開発用に特定のS3バケットにのみアクセス可能なユーザーを作成したかったのでメモ。

まずはIAMユーザーを作成しておく。
ポリシーを以下のJSONのように作成し、IAMユーザーにアタッチする。
/*はつけないとバケット配下のオブジェクトへの書き込みが403になる。

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::<バケット名>",
                "arn:aws:s3:::<バケット名>/*"
            ]
        }
    ]
}

参考

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?