LoginSignup
19
19

More than 5 years have passed since last update.

S3バケットに対して別のAWSアカウントからのアクセスを許可する

Last updated at Posted at 2014-11-11

この投稿は個人的な意見/メモであり、会社を代表するものではありません。

--

対象バケットのバケットポリシーを編集

Edit bucket policyのボタンを押す

image1

JSONで記述したポリシーをはりつけてSave

image1

JSONはこんな感じ。YOUR_BUCKET_NAMEは自分のS3バケット名、TARGET_AWS_ACCOUNT_IDはアクセス元のAWSのIDに置き換える。


{
    "Id": "Policy1407414264995",
    "Statement": [
        {
            "Sid": "Stmt1407414232771",
            "Action": [
                "s3:ListBucket"
            ],
            "Effect": "Allow",
            "Resource": "arn:aws:s3:::YOUR_BUCKET_NAME",
            "Principal": {
                "AWS": [
                    "arn:aws:iam::TARGET_AWS_ACCOUNT_ID:root"
                ]
            }
        },
        {
            "Sid": "Stmt1407414262750",
            "Action": [
                "s3:GetObject"
            ],
            "Effect": "Allow",
            "Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*",
            "Principal": {
                "AWS": [
                    "arn:aws:iam::TARGET_AWS_ACCOUNT_ID:root"
                ]
            }
        }
    ]
}

19
19
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
19
19