We recommend that you create your S3 Metadata configurations by using the V2 CreateBucketMetadataConfiguration API operation. We no longer recommend using the V1 CreateBucketMetadataTableConfiguration API operation.
If you created your S3 Metadata configuration before July 15, 2025, we recommend that you delete and re-create your configuration by using CreateBucketMetadataConfiguration so that you can expire journal table records and create a live inventory table.
Creates a V1 S3 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. 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.
The following operations are related to CreateBucketMetadataTableConfiguration:
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:
-
bucket
(BucketName)
–
The general purpose bucket that you want to create the metadata table configuration for.
-
content_md5
(Optional[ContentMD5], default:
None
)
–
The Content-MD5 header for the metadata table configuration.
-
checksum_algorithm
(Optional[ChecksumAlgorithm], default:
None
)
–
The checksum algorithm to use with your metadata table configuration.
-
metadata_table_configuration
(MetadataTableConfiguration)
–
The contents of your metadata table configuration.
-
expected_bucket_owner
(Optional[AccountId], default:
None
)
–
The expected owner of the general purpose bucket that corresponds to your metadata table configuration.
Raises:
Source code in docs_src/capo_s3/_services/s3.py
| def create_bucket_metadata_table_configuration(
self,
bucket: "capo_s3.types.bucket_name.BucketName",
metadata_table_configuration: "capo_s3.types.metadata_table_configuration.MetadataTableConfiguration",
*,
config_overrides: Optional[S3ClientConfig] = None,
content_md5: Optional["capo_s3.types.content_md5.ContentMD5"] = None,
checksum_algorithm: Optional[
"capo_s3.types.checksum_algorithm.ChecksumAlgorithm"
] = None,
expected_bucket_owner: Optional["capo_s3.types.account_id.AccountId"] = None,
) -> None:
"""<important> <p> We recommend that you create your S3 Metadata configurations by using the V2 <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataConfiguration.html">CreateBucketMetadataConfiguration</a> API operation. We no longer recommend using the V1 <code>CreateBucketMetadataTableConfiguration</code> API operation. </p> <p>If you created your S3 Metadata configuration before July 15, 2025, we recommend that you delete and re-create your configuration by using <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataConfiguration.html">CreateBucketMetadataConfiguration</a> so that you can expire journal table records and create a live inventory table.</p> </important> <p>Creates a V1 S3 Metadata configuration for a general purpose bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-overview.html">Accelerating data discovery with S3 Metadata</a> in the <i>Amazon S3 User Guide</i>.</p> <dl> <dt>Permissions</dt> <dd> <p>To use this operation, you must have the following permissions. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-permissions.html">Setting up permissions for configuring metadata tables</a> in the <i>Amazon S3 User Guide</i>.</p> <p>If you want to encrypt your metadata tables with server-side encryption with Key Management Service (KMS) keys (SSE-KMS), you need additional permissions. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-permissions.html"> Setting up permissions for configuring metadata tables</a> in the <i>Amazon S3 User Guide</i>.</p> <p>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 <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-integrating-aws.html"> Integrating Amazon S3 Tables with Amazon Web Services analytics services</a> in the <i>Amazon S3 User Guide</i>.</p> <ul> <li> <p> <code>s3:CreateBucketMetadataTableConfiguration</code> </p> </li> <li> <p> <code>s3tables:CreateNamespace</code> </p> </li> <li> <p> <code>s3tables:GetTable</code> </p> </li> <li> <p> <code>s3tables:CreateTable</code> </p> </li> <li> <p> <code>s3tables:PutTablePolicy</code> </p> </li> </ul> </dd> </dl> <p>The following operations are related to <code>CreateBucketMetadataTableConfiguration</code>:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetadataTableConfiguration.html">DeleteBucketMetadataTableConfiguration</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetadataTableConfiguration.html">GetBucketMetadataTableConfiguration</a> </p> </li> </ul> <important> <p>You must URL encode any signed header values that contain spaces. For example, if your header value is <code>my file.txt</code>, containing two spaces after <code>my</code>, you must URL encode this value to <code>my%20%20file.txt</code>.</p> </important>
Args:
bucket: <p> The general purpose bucket that you want to create the metadata table configuration for. </p>
content_md5: <p> The <code>Content-MD5</code> header for the metadata table configuration. </p>
checksum_algorithm: <p> The checksum algorithm to use with your metadata table configuration. </p>
metadata_table_configuration: <p> The contents of your metadata table configuration. </p>
expected_bucket_owner: <p> The expected owner of the general purpose bucket that corresponds to your metadata table configuration. </p>
Raises:
capo_s3.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_s3.types.create_bucket_metadata_table_configuration_request.CreateBucketMetadataTableConfigurationRequest]",
) -> OperationResponse[None]:
import capo_s3._operations.amazon_s3.create_bucket_metadata_table_configuration
output, http_response = (
capo_s3._operations.amazon_s3.create_bucket_metadata_table_configuration.create_bucket_metadata_table_configuration(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateBucketMetadataTableConfiguration")
)
input_: capo_s3.types.create_bucket_metadata_table_configuration_request.CreateBucketMetadataTableConfigurationRequest = {
"bucket": bucket,
"metadata_table_configuration": metadata_table_configuration,
}
if content_md5 is not None:
input_["content_md5"] = content_md5
if checksum_algorithm is not None:
input_["checksum_algorithm"] = checksum_algorithm
if expected_bucket_owner is not None:
input_["expected_bucket_owner"] = expected_bucket_owner
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|