An S3 tag is a key-value pair that is used to categorize objects. You can add tags to new objects when you upload them or add tags to existing buckets and objects. S3 object tags and bucket tags can be added to objects and buckets via S3 API calls. Tags are stored per element.
If VAST Catalog is enabled, S3 tags are saved together with other element attributes, which lets you search for data based on S3 tags.
Restrictions and Limitations
You can associate up to 40 tags with an object.
The key and values are case sensitive.
Tags that are associated with an object must have unique tag keys.
A tag key can be up to 128 Unicode characters in length, and tag values can be up to 256 Unicode characters in length.
Tags are not supported in lifecycle rules, such as to limit the scope of objects to those that have a given tag.
Tags are not supported in identity policies, such as to limit the scope of a user's access to objects that have a given tag.
Object Tagging and Replication
If you configure replication on S3 buckets and objects that have tags, the tags are replicated.
Managing S3 Tags
The following S3 API requests and headers are supported and require user permission to perform the relevant actions. Permission to perform these actions can be granted through S3 identity policies.
Operation | Request Type | Action Requiring Permission | More details |
|---|---|---|---|
Set tags to an object |
| Permission to perform the | You specify tags in the request body. When this operation sets the tags for an object, it will overwrite any current tags the bucket already has. You cannot use this operation to add tags to an existing list of tags. |
Return the tag-set associated with an object |
| Permission to perform the | The object tags are returned in the response body. |
Remove the entire tag set associated with an object |
| Permission to perform the s3:DeleteObjectTagging action | |
Set tags on a bucket |
| Permissions to perform the | When this operation sets the tags for a bucket, it will overwrite any current tags the bucket already has. You cannot use this operation to add tags to an existing list of tags. |
Return the tag set associated with a bucket |
| Permission to perform the | |
Delete the tags from a bucket |
| Permission to perform the | |
Set tags when uploading an object | When uploading with a | Permission to perform the | The tag-set must be encoded as URL Query parameters. (For example, "Key1=Value1") |
Return object tag count | The | Permission to perform the | |
Copy or replace tags when copying an object | When making an If replacing the tags, provide the tags using the | Permission to perform the |
Valid values:
|
Tagging Examples
This example uses the put_object_tagging Boto3 client method to create a tagset consisting of a single tag with key "department" and value "Sales":
put_object_tagging( Bucket=S3_BUCKET, Key=s3_key, Tagging={ 'TagSet': [ { 'Key': 'Department', 'Value': 'Sales' }]
}, )In this example, also using Boto client, tags are passed in a put_object request
put_object(Bucket=S3_BUCKET, Key=s3_key, Tagging="Department=Sales&Company=Vast")
Querying VAST Catalog for S3 Tags
VAST Catalog indexes S3 tags in a column called user_tags, enabling data to be searchable by the key-value pairs contained in the tags. For more granular searchability, you can also define a VAST Catalog column per key value so that users can use VAST Catalog to search for data by key value. For example, if you use tagging to classify objects per department, using tags with key "Department" and values per department, such as "Sales", "Marketing," and "Product", you can add a column for the key value "Department" and that will enable users to search for all objects belonging to "Sales," by querying the "Department" column that you defined and searching for the value "Sales".
For details of how to configure VAST Catalog and add columns for S3 tags, see Configuring VAST Catalog.
For details of how to query VAST Catalog from VMS, see Querying VAST Catalog from the VAST Web UI.
For all information about VAST Catalog, see VAST Catalog.