boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden

后端 未结 9 1185
感情败类
感情败类 2020-11-29 19:13

I\'m trying to get django to upload static files to S3, but istead I\'m getting a 403 forbidden error, and I\'m not sure why.

Full Stacktrace:

9条回答
  •  鱼传尺愫
    2020-11-29 19:39

    I'm using Amazon IAM for the particular key ID and access key and just bumped into the same 403 Forbidden... Turns out you need to give permissions that target both the bucket root and its subobjects:

    {
      "Statement": [
        {
          "Principal": {
              "AWS": "*"
          },
          "Effect": "Allow",
          "Action": "s3:*",
          "Resource": ["arn:aws:s3:::bucket-name/*", "arn:aws:s3:::bucket-name"]
        }
      ]
    }
    

提交回复
热议问题