Movatterモバイル変換


[0]ホーム

URL:


Working with object metadata - Amazon Simple Storage Service
DocumentationAmazon Simple Storage Service (S3)User Guide
System-defined object metadataUser-defined object metadata

Working with object metadata

There are two kinds of object metadata in Amazon S3:system-defined metadata anduser-defined metadata. System-defined metadata includes metadata such as the object's creation date, size, and storage class. User-defined metadata is metadata that you can choose to set at the time that you upload an object. This user-defined metadata is a set of name-value pairs. For more information, seeSystem-defined object metadata andUser-defined object metadata.

When you create an object, you specify theobject key (orkey name), which uniquely identifies the object in an Amazon S3 bucket. For more information, seeNaming Amazon S3 objects. You can also setuser-defined metadata in Amazon S3 at the time that you upload the object.

After you upload the object, you can't modify this user-defined metadata. The only way to modify this metadata is to make a copy of the object and set the metadata. For more information about editing metadata by using the Amazon S3 console, seeEditing object metadata in the Amazon S3 console.

Query your metadata and accelerate data discovery with S3 Metadata

To easily find, store, and query metadata for your S3 objects, you can use S3 Metadata. With S3 Metadata, you can quickly prepare data for use in business analytics, content retrieval, artificial intelligence and machine learning (AI/ML) model training, and more.

S3 Metadata accelerates data discovery by automatically capturing metadata for the objects in your general purpose buckets and storing it in read-only, fully managed Apache Iceberg tables that you can query. These read-only tables are calledmetadata tables. As objects are added to, updated, and removed from your general purpose buckets, S3 Metadata automatically refreshes the corresponding metadata tables to reflect the latest changes.

By default, S3 Metadata providessystem-defined object metadata, such as an object's creation time and storage class, and custom metadata, such as tags anduser-defined metadata that was included during object upload. S3 Metadata also provides event metadata, such as when an object is updated or deleted, and the AWS account that made the request.

Metadata tables are stored in S3 table buckets, which provide storage that's optimized for tabular data. To query your metadata, you can integrate your table bucket with AWS analytics services, such as Amazon Athena, Amazon Redshift, and Amazon Quick Suite.

For more information about S3 Metadata, seeDiscovering your data with S3 Metadata tables.

System-defined object metadata

For each object stored in a bucket, Amazon S3 maintains a set of system metadata. Amazon S3 processes this system metadata as needed. For example, Amazon S3 maintains object-creation date and size metadata, using this information as part of object management.

There are two categories of system metadata:

  • System controlled – Metadata such as the object-creation date is system controlled, which means that only Amazon S3 can modify the date value.

  • User controlled – Other system metadata, such as the storage class configured for the object and whether the object has server-side encryption enabled, are examples of system metadata whose values you control. If your bucket is configured as a website, sometimes you might want to redirect a page request either to another page or an external URL. In this case, a webpage is an object in your bucket. Amazon S3 stores the page redirect value as system metadata, which you can control.

    When you create objects, you can configure the values of these system metadata items or update the values when you need to. For more information about storage classes, seeUnderstanding and managing Amazon S3 storage classes.

    Amazon S3 uses AWS KMS keys to encrypt your Amazon S3 objects. AWS KMS encrypts only the object data. The checksum and the specified algorithm are stored as part of the object's metadata. If server-side encryption is requested for the object, then the checksum is stored in encrypted form. For more information about server-side encryption, seeProtecting data with encryption.

The following table provides a list of system-defined metadata and whether you can update it.

NameDescriptionCan user modify the value?
DateThe current date and time.No
Cache-ControlA general header field used to specify caching policies.Yes
Content-DispositionObject presentational information.Yes
Content-EncodingThe content encodings (like compression) that have been applied to the object's dataYes
Content-LengthThe object size in bytes.No
Content-TypeThe object type.Yes
Last-Modified

The object creation date or the last modified date, whichever is the latest. For multipart uploads, the object creation date is the date of initiation of the multipart upload.

No
ETagAn entity tag (ETag) that represents a specific version of an object. For objects that are not uploaded as a multipart upload and are either unencrypted or encrypted by server-side encryption with Amazon S3 managed keys (SSE-S3), the ETag is an MD5 digest of the data.No
x-amz-server-side-encryptionA header that indicates whether server-side encryption is enabled for the object, and whether that encryption is using the AWS Key Management Service (AWS KMS) keys (SSE-KMS) or using Amazon S3 managed encryption keys (SSE-S3). For more information, seeProtecting data with server-side encryption.Yes
x-amz-checksum-crc64nvme,x-amz-checksum-crc32,x-amz-checksum-crc32c,x-amz-checksum-sha1,x-amz-checksum-sha256Headers that contain the checksum or digest of the object. At most, one of these headers will be set at a time, depending on the checksum algorithm that you instruct Amazon S3 to use. For more information about choosing the checksum algorithm, seeChecking object integrity in Amazon S3.No
x-amz-checksum-typeThe checksum type, which determines how part-level checksums are combined to create an object-level checksum for multipart objects.Yes
x-amz-version-idThe object version. When you enable versioning on a bucket, Amazon S3 assigns a version ID to objects added to the bucket. For more information, seeRetaining multiple versions of objects with S3 Versioning.No
x-amz-delete-markerA Boolean marker that indicates whether the object is a delete marker. This marker is used only in buckets that have versioning enabled,No
x-amz-storage-classThe storage class used for storing the object. For more information, seeUnderstanding and managing Amazon S3 storage classes.Yes
x-amz-website-redirect-location A header that redirects requests for the associated object to another object in the same bucket or to an external URL. For more information, see(Optional) Configuring a webpage redirect.Yes
x-amz-server-side-encryption-aws-kms-key-idA header that indicates the ID of the AWS KMS symmetric encryption KMS key that was used to encrypt the object. This header is used only when thex-amz-server-side-encryption header is present and has the value ofaws:kms.Yes
x-amz-server-side-encryption-customer-algorithmA header that indicates whether server-side encryption with customer-provided encryption keys (SSE-C) is enabled. For more information, seeUsing server-side encryption withcustomer-provided keys (SSE-C).Yes
x-amz-taggingThe tag-set for the object. The tag-set must be encoded as URL Query parameters.Yes

User-defined object metadata

When uploading an object, you can also assign metadata to the object. You provide this optional information as a name-value (key-value) pair when you send aPUT orPOST request to create the object. When you upload objects using the REST API, the optional user-defined metadata names must begin withx-amz-meta- to distinguish them from other HTTP headers. When you retrieve the object using the REST API, this prefix is returned. When you upload objects using the SOAP API, the prefix is not required. When you retrieve the object using the SOAP API, the prefix is removed, regardless of which API you used to upload the object.

When metadata is retrieved through the REST API, Amazon S3 combines headers that have the same name (ignoring case) into a comma-delimited list. If some metadata contains unprintable characters, it is not returned. Instead, thex-amz-missing-meta header is returned with a value of the number of unprintable metadata entries. TheHeadObject action retrieves metadata from an object without returning the object itself. This operation is useful if you're only interested in an object's metadata. To useHEAD, you must haveREAD access to the object. For more information, seeHeadObject in the Amazon Simple Storage Service API Reference.

User-defined metadata is a set of key-value pairs. Amazon S3 stores user-defined metadata keys in lowercase.

Amazon S3 allows arbitrary Unicode characters in your metadata values.

To avoid issues related to the presentation of these metadata values, you should conform to using US-ASCII characters when using REST and UTF-8 when using SOAP or browser-based uploads throughPOST.

When using non-US-ASCII characters in your metadata values, the provided Unicode string is examined for non-US-ASCII characters. Values of such headers are character decoded as perRFC 2047 before storing and encoded as perRFC 2047 to make them mail-safe before returning. If the string contains only US-ASCII characters, it is presented as is.

The following is an example.

PUT /Key HTTP/1.1Host:amzn-s3-demo-bucket.s3.amazonaws.comx-amz-meta-nonascii: ÄMÄZÕÑ S3HEAD /Key HTTP/1.1Host:amzn-s3-demo-bucket.s3.amazonaws.comx-amz-meta-nonascii: =?UTF-8?B?w4PChE3Dg8KEWsODwpXDg8KRIFMz?=PUT /Key HTTP/1.1Host:amzn-s3-demo-bucket.s3.amazonaws.comx-amz-meta-ascii: AMAZONS3HEAD /Key HTTP/1.1Host:amzn-s3-demo-bucket.s3.amazonaws.comx-amz-meta-ascii: AMAZONS3

For information about changing the metadata of your object after it has been uploaded by creating a copy of the object, modifying it, and replacing the old object, or creating a new version, seeEditing object metadata in the Amazon S3 console.

Naming objects
Editing object metadata

[8]
ページ先頭

©2009-2026 Movatter.jp