小编and*_*ien的帖子

aws s3 cp返回调用HeadObject操作时发生错误(403):禁止

前言

我想这可能是重复的,但其他有相同问题的帖子并没有太大帮助。

一个问题

aws s3 cp s3://s3-us-west-2.amazonaws.com/my-test-bucket/intro.jpg test.jpg
输出以下内容:
fatal error: An error occurred (403) when calling the HeadObject operation: Forbidden

值区政策:

{
    "Version": "2012-10-17",
    "Id": "Policy1539624480514",
    "Statement": [
        {
            "Sid": "Stmt1539624478431",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::my-test-bucket",
                "arn:aws:s3:::my-test-bucket/*"
            ]
        }
    ]
}
Run Code Online (Sandbox Code Playgroud) 一些注意事项
  1. intro.jpg 是由用户A(具有AdministratorAccess)通过AWS Console仪表板添加的(不是在存储桶之间复制文件)
  2. aws sts get-caller-identity 向我返回有关用户A的信息

    {
        "Version": "2012-10-17",
        "Id": "Policy1539624480514",
        "Statement": [
            {
                "Sid": "Stmt1539624478431",
                "Effect": "Allow",
                "Principal": "*",
                "Action": "s3:*",
                "Resource": [
                    "arn:aws:s3:::my-test-bucket",
                    "arn:aws:s3:::my-test-bucket/*"
                ]
            }
        ]
    }
    
    Run Code Online (Sandbox Code Playgroud)

  3. cat ~/.aws/config …

amazon-s3 amazon-web-services

5
推荐指数
1
解决办法
4988
查看次数

标签 统计

amazon-s3 ×1

amazon-web-services ×1