Updates the annotation table configuration for an Amazon S3 bucket's metadata configuration. Use this operation to enable or disable the annotation table, or to update its associated IAM role.
An annotation table is a queryable Iceberg table that contains records of all annotations attached to objects in the bucket. To use this operation, the bucket must have an existing Amazon S3 Metadata configuration.
To use this operation, you must have the s3:UpdateBucketMetadataAnnotationTableConfiguration permission. If you are specifying or changing the IAM role, you must also have iam:PassRole permission for the role.
The IAM 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.
The following operations are related to UpdateBucketMetadataAnnotationTableConfiguration:
Parameters:
-
bucket
(BucketName)
–
The name of the bucket whose annotation table configuration to update.
-
content_md5
(Optional[ContentMD5], default:
None
)
–
Base64-encoded MD5 digest of the message body.
-
checksum_algorithm
(Optional[ChecksumAlgorithm], default:
None
)
–
Checksum algorithm for the request payload.
-
annotation_table_configuration
(AnnotationTableConfigurationUpdates)
–
The annotation table configuration updates to apply.
-
expected_bucket_owner
(Optional[AccountId], default:
None
)
–
The account ID of the expected bucket owner.
Raises:
Source code in docs_src/capo_s3/_services/async_s3.py
| async def update_bucket_metadata_annotation_table_configuration(
self,
bucket: "capo_s3.types.bucket_name.BucketName",
annotation_table_configuration: "capo_s3.types.annotation_table_configuration_updates.AnnotationTableConfigurationUpdates",
*,
config_overrides: Optional[AsyncS3ClientConfig] = 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:
"""<p>Updates the annotation table configuration for an Amazon S3 bucket's metadata configuration. Use this operation to enable or disable the annotation table, or to update its associated IAM role.</p> <p>An annotation table is a queryable Iceberg table that contains records of all annotations attached to objects in the bucket. To use this operation, the bucket must have an existing Amazon S3 Metadata configuration.</p> <p>To use this operation, you must have the <code>s3:UpdateBucketMetadataAnnotationTableConfiguration</code> permission. If you are specifying or changing the IAM role, you must also have <code>iam:PassRole</code> permission for the role.</p> <p>The IAM 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.</p> <p>The following operations are related to <code>UpdateBucketMetadataAnnotationTableConfiguration</code>:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataConfiguration.html">CreateBucketMetadataConfiguration</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetadataConfiguration.html">GetBucketMetadataConfiguration</a> </p> </li> </ul>
Args:
bucket: <p>The name of the bucket whose annotation table configuration to update.</p>
content_md5: <p>Base64-encoded MD5 digest of the message body.</p>
checksum_algorithm: <p>Checksum algorithm for the request payload.</p>
annotation_table_configuration: <p>The annotation table configuration updates to apply.</p>
expected_bucket_owner: <p>The account ID of the expected bucket owner.</p>
Raises:
capo_s3.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_s3.types.update_bucket_metadata_annotation_table_configuration_request.UpdateBucketMetadataAnnotationTableConfigurationRequest]",
) -> AsyncOperationResponse[None]:
import capo_s3._operations.amazon_s3.update_bucket_metadata_annotation_table_configuration
(
output,
http_response,
) = await capo_s3._operations.amazon_s3.update_bucket_metadata_annotation_table_configuration.async_update_bucket_metadata_annotation_table_configuration(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("UpdateBucketMetadataAnnotationTableConfiguration"),
)
input_: capo_s3.types.update_bucket_metadata_annotation_table_configuration_request.UpdateBucketMetadataAnnotationTableConfigurationRequest = {
"bucket": bucket,
"annotation_table_configuration": annotation_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 = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|