简体   繁体   English

权限问题:列出s3存储桶

[英]Permission issues with: listing s3 buckets

What permission do I need to change to allow listing all s3 buckets? 我需要更改哪些权限才能列出所有s3存储桶?

I can run: aws s3 ls s3://bucketname; 我可以运行: aws s3 ls s3://bucketname; but I cannot run: aws s3 ls; 但我不能跑: aws s3 ls;

The bucket policy is this: 存储桶策略是这样的:

    "Version": "2012-10-17",
    "Statement": [

        {
            "Sid": "Sid",
            "Effect": "Allow",
            "Principal": {
                "AWS": [
                    "arn:aws:iam::6666666:user/myuser"
                ]
            },
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": "arn:aws:s3:::bucketname"
        }
    ]
}

Credit due from this post: https://stackoverflow.com/a/35746318/1242581 这篇文章的信用额度: https//stackoverflow.com/a/35746318/1242581

I needed the ListAllMyBuckets action on my user or user's group: 我需要对我的用户或用户组执行ListAllMyBuckets操作:

{
    "Sid": "AllowListingOfAllBuckets",
    "Effect": "Allow",
    "Action": [
        "s3:ListAllMyBuckets"
    ],
    "Resource": [
        "arn:aws:s3:::*"
    ]
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM