10

If there is a bucket that I have read/write access on from my AWS account, is there any way to get the CanonicalUser id of the owner?

Reading the ACL Policy seems to be impossible unless you are the owner : /.

Gillfish
  • 717
  • 1
  • 9
  • 29
Felix Geisendörfer
  • 2,902
  • 5
  • 27
  • 36

2 Answers2

10

Use get-bucket-acl, if you have read permission of the bucket. It would give output like this

{
    "Owner": {
        "DisplayName": "my-username",
        "ID": "7009a8971cd538e11f6b6606438875e7c86c5b672f46db45460ddcd087d36c32"
    },
    "Grants": [
        {
            "Grantee": {
                "DisplayName": "my-username",
                "ID": "7009a8971cd538e11f6b6606438875e7c86c5b672f46db45460ddcd087d36c32"
            },
            "Permission": "FULL_CONTROL"
        }
    ]
}
YufengJ
  • 101
  • 1
  • 5
0

Have you tried the GET Bucket transaction? It is used for listing objects inside a bucket, and it also returns a tag that, although looks like being the object owner, according to the docs it is the bucket owner:

Owner
Bucket owner.
Type: String
Children: DisplayName, ID
Ancestor: ListBucketResult.Contents | CommonPrefixes

Viccari
  • 9,029
  • 4
  • 43
  • 77
  • 1
    object owner is not bucket owner – homm Jul 09 '14 at 15:35
  • @homm Yeah, but from the question I understood the OP wanted to know the bucket owner... – Viccari Jul 09 '14 at 21:56
  • Seem like a error in documentation. `ListBucketResult.Contents` is objects in bucket, so `ListBucketResult.Contents.Owner` is object's owner. – homm Jul 10 '14 at 07:19