Movatterモバイル変換


[0]ホーム

URL:


Categorizing your storage using tags - Amazon Simple Storage Service
DocumentationAmazon Simple Storage Service (S3)User Guide
API operations related to object taggingAdditional configurations

Categorizing your storage using tags

Use object tagging to categorize storage. Each tag is a key-value pair.

You can add tags to new objects when you upload them, or you can add them to existing objects.

Examples

Consider the following tagging examples:

Example PHI information

Suppose that an object contains protected health information (PHI) data. You might tag the object using the following key-value pair.

PHI=True

or

Classification=PHI
Key name prefixes and tags

Object key name prefixes also enable you to categorize storage. However, prefix-based categorization is one-dimensional. Consider the following object key names:

photos/photo1.jpgproject/projectx/document.pdfproject/projecty/document2.pdf

These key names have the prefixesphotos/,project/projectx/, andproject/projecty/. These prefixes enable one-dimensional categorization. That is, everything under a prefix is one category. For example, the prefixproject/projectx identifies all documents related to project x.

With tagging, you now have another dimension. If you want photo1 in project x category, you can tag the object accordingly.

Additional benefits

In addition to data classification, tagging offers benefits such as the following:

Adding object tag sets to multiple Amazon S3 object with a single request

To add object tag sets to more than one Amazon S3 object with a single request, you can use S3 Batch Operations. You provide S3 Batch Operations with a list of objects to operate on. S3 Batch Operations calls the respective API operation to perform the specified operation. A single Batch Operations job can perform the specified operation on billions of objects containing exabytes of data.

The S3 Batch Operations feature tracks progress, sends notifications, and stores a detailed completion report of all actions, providing a fully managed, auditable, serverless experience. You can use S3 Batch Operations through the Amazon S3 console, AWS CLI, AWS SDKs, or REST API. For more information, seeS3 Batch Operations basics.

For more information about object tags, seeManaging object tags.

API operations related to object tagging

Amazon S3 supports the following API operations that are specifically for object tagging:

Object API operations

Other API operations that support tagging

  • PUT Object andInitiate Multipart Upload– You can specify tags when you create objects. You specify tags using thex-amz-tagging request header.

  • GET Object – Instead of returning the tag set, Amazon S3 returns the object tag count in thex-amz-tag-count header (only if the requester has permissions to read tags) because the header response size is limited to 8 K bytes. If you want to view the tags, you make another request for theGET Object tagging API operation.

  • POST Object – You can specify tags in your POST request.

    As long as the tags in your request don't exceed the 8 K byte HTTP request header size limit, you can use thePUT ObjectAPI to create objects with tags. If the tags you specify exceed the header size limit, you can use this POST method in which you include the tags in the body.

    PUT Object - Copy – You can specify thex-amz-tagging-directive in your request to direct Amazon S3 to either copy (default behavior) the tags or replace tags by a new set of tags provided in the request.

Note the following:

Additional configurations

This section explains how object tagging relates to other configurations.

Object tagging and lifecycle management

In bucket lifecycle configuration, you can specify a filter to select a subset of objects to which the rule applies. You can specify a filter based on the key name prefixes, object tags, or both.

Suppose that you store photos (raw and the finished format) in your Amazon S3 bucket. You might tag these objects as shown following.

phototype=raworphototype=finished

You might consider archiving the raw photos to S3 Glacier sometime after they are created. You can configure a lifecycle rule with a filter that identifies the subset of objects with the key name prefix (photos/) that have a specific tag (phototype=raw).

For more information, seeManaging the lifecycle of objects.

Object tagging and replication

If you configured Replication on your bucket, Amazon S3 replicates tags, provided you grant Amazon S3 permission to read the tags. For more information, seeSetting up live replication overview.

Object tagging event notifications

You can set up an Amazon S3 event notification to receive notice when an object tag is added or deleted from an object. Thes3:ObjectTagging:Put event type notifies you when a tag is PUT on an object or when an existing tag is updated. Thes3:ObjectTagging:Delete event type notifies you when a tag is removed from an object. For more information, see Enabling event notifications.

For more information about object tagging, see the following topics:

Viewing object properties
Controlling access with tags

[8]
ページ先頭

©2009-2025 Movatter.jp