Skip to main content

GetBucketTagging

GetBucketTagging returns the tag set of a bucket. Buckets on STRG carry no tags, so there is never a tag set to return: the operation checks that the bucket exists and answers 404 NoSuchTagSet - the same answer Amazon S3 gives for a bucket without tags. Tools that read bucket tags while describing or managing a bucket, such as Terraform's aws_s3_bucket resource, read that answer as "no tags" and carry on unchanged.

Good to know on STRG
  • Buckets have no tags, so GetBucketTagging always answers 404 NoSuchTagSet for a bucket that exists.
  • PutBucketTagging is answered with 501 NotImplemented, so a client knows straight away, and DeleteBucketTagging succeeds and leaves the bucket as it was.
  • Every access key can call it, on every bucket the key reaches.
  • x-amz-expected-bucket-owner is welcome and has nothing to check: a key only ever reaches buckets of its own account.

When you'd use it​

  • Infrastructure as code. Terraform's aws_s3_bucket resource, and similar tools that compare a bucket with its configuration, read the bucket's tags along the way. The NoSuchTagSet answer tells them there are none, so a plan shows no tag changes.
  • Describing a bucket. The AWS CLI and inventory scripts that gather everything about a bucket ask for its tags too, and record an empty set.
  • Scripts written for Amazon S3. Code that already treats NoSuchTagSet as "no tags" - as most code does, since that is S3's own answer for an untagged bucket - runs unchanged against STRG.

Request​

GET /?tagging HTTP/1.1
Host: my-bucket.s3.eu-central-1.strg.com
Authorization: AWS4-HMAC-SHA256 Credential=...
x-amz-date: 20260926T120000Z
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

The path-style form is GET /my-bucket?tagging on s3.eu-central-1.strg.com - Addressing explains both.

Permissions​

Every access key can call this operation: Read bucket settings (buckets:read-config) is always included. A key limited to certain buckets reaches only those buckets, and any other bucket answers 403 AccessDenied. Access keys has the details.

URI parameters​

NameTypeRequiredDescription
BucketStringYesThe bucket whose tag set is read.
taggingFlagYesSelects this operation. Sent with no value.

Any other query parameter is answered 501 NotImplemented, so a client knows straight away that it has no effect here.

Request headers​

NameTypeRequiredDescription
x-amz-expected-bucket-ownerStringNoWelcome, with nothing to check: an access key only ever reaches its own account's buckets.

Request body​

None.

Response​

STRG answers this operation with 404 NoSuchTagSet for every bucket that exists, never with 200 OK.

Response headers​

NameDescription
Content-Typeapplication/xml.
x-amz-request-idThe request ID, handy for a support request.

Response body​

An S3 error document. For a virtual-hosted request to my-bucket:

<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>NoSuchTagSet</Code>
<Message>The TagSet does not exist</Message>
<Resource>/</Resource>
<BucketName>my-bucket</BucketName>
<RequestId>4442587FB7D0A2F9</RequestId>
</Error>

For reference, these are the members of the success response Amazon S3 defines. STRG never returns them, since a bucket has no tags to put in them.

ElementTypeDescription
TaggingContainerThe root element.
TagSetContainerThe bucket's tags.
TagContainerOne tag, with a Key and a Value.

Errors​

These are the answers this request can return, and the situation behind each one.

CodeHTTP statusWhen
NoSuchTagSet404Always, once the bucket is confirmed to exist. It means "no tags", exactly as on Amazon S3.
NoSuchBucket404The bucket does not exist, it is in a region other than the endpoint's, or the account has no storage in this endpoint's region yet.
AccessDenied403The access key is limited to buckets that do not include this one, the account is not active, or the request is unsigned.
InvalidAccessKeyId403The access key does not exist, has expired or been revoked - or it was created moments ago and is not usable in this endpoint's region yet, where the account already stores data, in which case the same request works shortly afterwards.
SignatureDoesNotMatch403The request signature does not match.
RequestTimeTooSkewed403The request time is more than 15 minutes from the server's.
AuthorizationHeaderMalformed400The signature's credential scope names a region other than the endpoint's.
NotImplemented501The request carries a query parameter this operation does not take.
SlowDown503Too many requests. The Retry-After header says when a retry is welcome; the AWS SDKs retry on their own.
ServiceUnavailable503A temporary failure; the same request can be retried.
InternalError500An unexpected failure while checking the bucket; the same request can be retried.

Differences from Amazon S3​

The table lists each place where STRG behaves differently, and what that means for a client.

AspectAmazon S3STRG
Bucket tagsStored, and returned by this operationBuckets have no tags; this operation always answers 404 NoSuchTagSet, S3's own answer for "no tags"
Permissions3:GetBucketTagging, granted per identityIncluded in every access key, for every bucket the key reaches
Bucket in another region301 redirect with x-amz-bucket-region404 NoSuchBucket. A bucket is reached through its own regional endpoint.
x-amz-expected-bucket-ownerChecked against the bucket ownerWelcome, with nothing to check

Examples​

Reading the tag set of my-bucket in eu-central-1, with NoSuchTagSet taken as an empty set:

aws s3api get-bucket-tagging \
--bucket my-bucket \
--endpoint-url https://s3.eu-central-1.strg.com \
--region eu-central-1

The command prints An error occurred (NoSuchTagSet) and exits with a non-zero code - the CLI's way of saying the bucket has no tags.

View as Markdown