Home > Enterprise >  Why is the "DisplayName" missing when getting the bucket ACL using s3api?
Why is the "DisplayName" missing when getting the bucket ACL using s3api?

Time:03-25

I am trying to get the display name of the owner of a bucket using the following command:

$ aws --profile <profile> s3api get-bucket-acl --bucket <bucket-name>

The response I get back is:

{
    "Owner": {
        "ID": "b<long-id>e"
    },
    "Grants": [
        {
            "Grantee": {
                "ID": "b<long-id>e",
                "Type": "CanonicalUser"
            },
            "Permission": "FULL_CONTROL"
        }
    ]
}

According to AWS s3api get-bucket-acl documentation the response should include the "DisplayName" such as:

{
    "Owner": {
        "DisplayName": "my-username",
        "ID": "7009a8971cd538e11f6b6606438875e7c86c5b672f46db45460ddcd087d36c32"
    },
    "Grants": [
        {
            "Grantee": {
                "DisplayName": "my-username",
                "ID": "7009a8971cd538e11f6b6606438875e7c86c5b672f46db45460ddcd087d36c32"
            },
            "Permission": "FULL_CONTROL"
        }
    ]
}

Why don't I get the "DisplayName" back?

Note: The aws version I am using is aws-cli/2.4.25 Python/3.8.8 Darwin/20.6.0 exe/x86_64 prompt/off

CodePudding user response:

I checked with AWS Support on this and according to the service team you can't rely on this information being present in all regions.

Apparently, this data is only returned in the regions that also return e-mail-addresses.

Note

Using email addresses to specify a grantee is only supported in the following AWS Regions:

  • US East (N. Virginia)

  • US West (N. California)

  • US West (Oregon)

  • Asia Pacific (Singapore)

  • Asia Pacific (Sydney)

  • Asia Pacific (Tokyo)

  • Europe (Ireland)

  • South America (São Paulo)

  • Related