Skip to main content

bucket_metadata_configurations

Creates, updates, deletes, gets or lists a bucket_metadata_configurations resource.

Overview

Namebucket_metadata_configurations
TypeResource
Idaws.s3.bucket_metadata_configurations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
metadata_configuration_resultstringThe metadata configuration for a general purpose bucket.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_bucket_metadata_configurationselectbucket, regionx-amz-expected-bucket-ownerRetrieves the S3 Metadata configuration for a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the Amazon S3 User Guide. You can use the V2 GetBucketMetadataConfiguration API operation with V1 or V2 metadata configurations. However, if you try to use the V1 GetBucketMetadataTableConfiguration API operation with V2 configurations, you will receive an HTTP 405 Method Not Allowed error. Permissions To use this operation, you must have the s3:GetBucketMetadataTableConfiguration permission. For more information, see Setting up permissions for configuring metadata tables in the Amazon S3 User Guide. The IAM policy action name is the same for the V1 and V2 API operations. The following operations are related to GetBucketMetadataConfiguration: CreateBucketMetadataConfiguration DeleteBucketMetadataConfiguration UpdateBucketMetadataInventoryTableConfiguration UpdateBucketMetadataJournalTableConfiguration You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.
create_bucket_metadata_configurationinsertbucket, region, MetadataConfigurationContent-MD5, x-amz-sdk-checksum-algorithm, x-amz-expected-bucket-ownerCreates an S3 Metadata V2 metadata configuration for a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the Amazon S3 User Guide. Permissions To use this operation, you must have the following permissions. For more information, see Setting up permissions for configuring metadata tables in the Amazon S3 User Guide. If you want to encrypt your metadata tables with server-side encryption with Key Management Service (KMS) keys (SSE-KMS), you need additional permissions in your KMS key policy. For more information, see Setting up permissions for configuring metadata tables in the Amazon S3 User Guide. If you also want to integrate your table bucket with Amazon Web Services analytics services so that you can query your metadata table, you need additional permissions. For more information, see Integrating Amazon S3 Tables with Amazon Web Services analytics services in the Amazon S3 User Guide. To query your metadata tables, you need additional permissions. For more information, see Permissions for querying metadata tables in the Amazon S3 User Guide. s3:CreateBucketMetadataTableConfiguration The IAM policy action name is the same for the V1 and V2 API operations. s3tables:CreateTableBucket s3tables:CreateNamespace s3tables:GetTable s3tables:CreateTable s3tables:PutTablePolicy s3tables:PutTableBucketPolicy s3tables:PutTableEncryption kms:DescribeKey iam:PassRole - required if you include an AnnotationTableConfiguration with an IAM role. The following operations are related to CreateBucketMetadataConfiguration: DeleteBucketMetadataConfiguration GetBucketMetadataConfiguration UpdateBucketMetadataInventoryTableConfiguration UpdateBucketMetadataJournalTableConfiguration UpdateBucketMetadataAnnotationTableConfiguration If you include an AnnotationTableConfiguration with an IAM role, the role must have a trust policy that allows the Amazon S3 metadata service to assume it, and a permissions policy that grants the actions needed to read annotations from your bucket. The following examples show a trust policy and a permissions policy that you can adapt for your bucket and account. You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.
delete_bucket_metadata_configurationdeletebucket, regionx-amz-expected-bucket-ownerDeletes an S3 Metadata configuration from a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the Amazon S3 User Guide. You can use the V2 DeleteBucketMetadataConfiguration API operation with V1 or V2 metadata configurations. However, if you try to use the V1 DeleteBucketMetadataTableConfiguration API operation with V2 configurations, you will receive an HTTP 405 Method Not Allowed error. Permissions To use this operation, you must have the s3:DeleteBucketMetadataTableConfiguration permission. For more information, see Setting up permissions for configuring metadata tables in the Amazon S3 User Guide. The IAM policy action name is the same for the V1 and V2 API operations. The following operations are related to DeleteBucketMetadataConfiguration: CreateBucketMetadataConfiguration GetBucketMetadataConfiguration UpdateBucketMetadataInventoryTableConfiguration UpdateBucketMetadataJournalTableConfiguration You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
bucketstringThe general purpose bucket that you want to remove the metadata configuration from.
regionstringAWS region (default: us-east-1)
Content-MD5stringThe Content-MD5 header for the metadata configuration.
x-amz-expected-bucket-ownerstringThe expected bucket owner of the general purpose bucket that you want to remove the metadata table configuration from.
x-amz-sdk-checksum-algorithmstringThe checksum algorithm to use with your metadata configuration.

SELECT examples

Retrieves the S3 Metadata configuration for a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the Amazon S3 User Guide. You can use the V2 GetBucketMetadataConfiguration API operation with V1 or V2 metadata configurations. However, if you try to use the V1 GetBucketMetadataTableConfiguration API operation with V2 configurations, you will receive an HTTP 405 Method Not Allowed error. Permissions To use this operation, you must have the s3:GetBucketMetadataTableConfiguration permission. For more information, see Setting up permissions for configuring metadata tables in the Amazon S3 User Guide. The IAM policy action name is the same for the V1 and V2 API operations. The following operations are related to GetBucketMetadataConfiguration: CreateBucketMetadataConfiguration DeleteBucketMetadataConfiguration UpdateBucketMetadataInventoryTableConfiguration UpdateBucketMetadataJournalTableConfiguration You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.

SELECT
metadata_configuration_result
FROM aws.s3.bucket_metadata_configurations
WHERE bucket = '{{ bucket }}' -- required
AND region = '{{ region }}' -- required
AND `x-amz-expected-bucket-owner` = '{{ x-amz-expected-bucket-owner }}'
;

INSERT examples

Creates an S3 Metadata V2 metadata configuration for a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the Amazon S3 User Guide. Permissions To use this operation, you must have the following permissions. For more information, see Setting up permissions for configuring metadata tables in the Amazon S3 User Guide. If you want to encrypt your metadata tables with server-side encryption with Key Management Service (KMS) keys (SSE-KMS), you need additional permissions in your KMS key policy. For more information, see Setting up permissions for configuring metadata tables in the Amazon S3 User Guide. If you also want to integrate your table bucket with Amazon Web Services analytics services so that you can query your metadata table, you need additional permissions. For more information, see Integrating Amazon S3 Tables with Amazon Web Services analytics services in the Amazon S3 User Guide. To query your metadata tables, you need additional permissions. For more information, see Permissions for querying metadata tables in the Amazon S3 User Guide. s3:CreateBucketMetadataTableConfiguration The IAM policy action name is the same for the V1 and V2 API operations. s3tables:CreateTableBucket s3tables:CreateNamespace s3tables:GetTable s3tables:CreateTable s3tables:PutTablePolicy s3tables:PutTableBucketPolicy s3tables:PutTableEncryption kms:DescribeKey iam:PassRole - required if you include an AnnotationTableConfiguration with an IAM role. The following operations are related to CreateBucketMetadataConfiguration: DeleteBucketMetadataConfiguration GetBucketMetadataConfiguration UpdateBucketMetadataInventoryTableConfiguration UpdateBucketMetadataJournalTableConfiguration UpdateBucketMetadataAnnotationTableConfiguration If you include an AnnotationTableConfiguration with an IAM role, the role must have a trust policy that allows the Amazon S3 metadata service to assume it, and a permissions policy that grants the actions needed to read annotations from your bucket. The following examples show a trust policy and a permissions policy that you can adapt for your bucket and account. You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.

INSERT INTO aws.s3.bucket_metadata_configurations (
MetadataConfiguration,
bucket,
region,
`Content-MD5`,
`x-amz-sdk-checksum-algorithm`,
`x-amz-expected-bucket-owner`
)
SELECT
'{{ MetadataConfiguration }}' /* required */,
'{{ bucket }}',
'{{ region }}',
'{{ Content-MD5 }}',
'{{ x-amz-sdk-checksum-algorithm }}',
'{{ x-amz-expected-bucket-owner }}'
;

DELETE examples

Deletes an S3 Metadata configuration from a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the Amazon S3 User Guide. You can use the V2 DeleteBucketMetadataConfiguration API operation with V1 or V2 metadata configurations. However, if you try to use the V1 DeleteBucketMetadataTableConfiguration API operation with V2 configurations, you will receive an HTTP 405 Method Not Allowed error. Permissions To use this operation, you must have the s3:DeleteBucketMetadataTableConfiguration permission. For more information, see Setting up permissions for configuring metadata tables in the Amazon S3 User Guide. The IAM policy action name is the same for the V1 and V2 API operations. The following operations are related to DeleteBucketMetadataConfiguration: CreateBucketMetadataConfiguration GetBucketMetadataConfiguration UpdateBucketMetadataInventoryTableConfiguration UpdateBucketMetadataJournalTableConfiguration You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.

DELETE FROM aws.s3.bucket_metadata_configurations
WHERE bucket = '{{ bucket }}' --required
AND region = '{{ region }}' --required
AND `x-amz-expected-bucket-owner` = '{{ x-amz-expected-bucket-owner }}'
;