bucket_metadata_configurations
Creates, updates, deletes, gets or lists a bucket_metadata_configurations resource.
Overview
| Name | bucket_metadata_configurations |
| Type | Resource |
| Id | aws.s3.bucket_metadata_configurations |
Fields
The following fields are returned by SELECT queries:
- get_bucket_metadata_configuration
| Name | Datatype | Description |
|---|---|---|
metadata_configuration_result | string | The metadata configuration for a general purpose bucket. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_bucket_metadata_configuration | select | bucket, region | x-amz-expected-bucket-owner | 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. |
create_bucket_metadata_configuration | insert | bucket, region, MetadataConfiguration | Content-MD5, x-amz-sdk-checksum-algorithm, x-amz-expected-bucket-owner | 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. |
delete_bucket_metadata_configuration | delete | bucket, region | x-amz-expected-bucket-owner | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
bucket | string | The general purpose bucket that you want to remove the metadata configuration from. |
region | string | AWS region (default: us-east-1) |
Content-MD5 | string | The Content-MD5 header for the metadata configuration. |
x-amz-expected-bucket-owner | string | The expected bucket owner of the general purpose bucket that you want to remove the metadata table configuration from. |
x-amz-sdk-checksum-algorithm | string | The checksum algorithm to use with your metadata configuration. |
SELECT examples
- get_bucket_metadata_configuration
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
- create_bucket_metadata_configuration
- Manifest
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 }}'
;
# Description fields are for documentation purposes
- name: bucket_metadata_configurations
props:
- name: bucket
value: "{{ bucket }}"
description: Required parameter for the bucket_metadata_configurations resource.
- name: region
value: "{{ region }}"
description: Required parameter for the bucket_metadata_configurations resource.
- name: MetadataConfiguration
description: |
The S3 Metadata configuration for a general purpose bucket.
value:
JournalTableConfiguration:
RecordExpiration:
Expiration: "{{ Expiration }}"
Days: {{ Days }}
EncryptionConfiguration:
SseAlgorithm: "{{ SseAlgorithm }}"
KmsKeyArn: "{{ KmsKeyArn }}"
InventoryTableConfiguration:
ConfigurationState: "{{ ConfigurationState }}"
EncryptionConfiguration:
SseAlgorithm: "{{ SseAlgorithm }}"
KmsKeyArn: "{{ KmsKeyArn }}"
AnnotationTableConfiguration:
ConfigurationState: "{{ ConfigurationState }}"
EncryptionConfiguration:
SseAlgorithm: "{{ SseAlgorithm }}"
KmsKeyArn: "{{ KmsKeyArn }}"
Role: "{{ Role }}"
- name: Content-MD5
value: "{{ Content-MD5 }}"
description: The Content-MD5 header for the metadata configuration.
description: The Content-MD5 header for the metadata configuration.
- name: x-amz-sdk-checksum-algorithm
value: "{{ x-amz-sdk-checksum-algorithm }}"
description: The checksum algorithm to use with your metadata configuration.
description: The checksum algorithm to use with your metadata configuration.
- name: x-amz-expected-bucket-owner
value: "{{ x-amz-expected-bucket-owner }}"
description: The expected owner of the general purpose bucket that corresponds to your metadata configuration.
description: The expected owner of the general purpose bucket that corresponds to your metadata configuration.
DELETE examples
- delete_bucket_metadata_configuration
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 }}'
;