Skip to content

create_table_bucket async

create_table_bucket(
    name: TableBucketName,
    *,
    config_overrides: Optional[AsyncS3TablesClientConfig] = None,
    encryption_configuration: Optional[EncryptionConfiguration] = None,
    storage_class_configuration: Optional[StorageClassConfiguration] = None,
    tags: Optional[Tags] = None,
) -> CreateTableBucketResponse

Creates a table bucket. For more information, see Creating a table bucket in the Amazon Simple Storage Service User Guide.

Permissions
  • You must have the s3tables:CreateTableBucket permission to use this operation.

  • If you use this operation with the optional encryptionConfiguration parameter you must have the s3tables:PutTableBucketEncryption permission.

  • If you use this operation with the storageClassConfiguration request parameter, you must have the s3tables:PutTableBucketStorageClass permission.

  • To create a table bucket with tags, you must have the s3tables:TagResource permission in addition to s3tables:CreateTableBucket permission.

Parameters:

  • name (TableBucketName) –

    The name for the table bucket.

  • encryption_configuration (Optional[EncryptionConfiguration], default: None ) –

    The encryption configuration to use for the table bucket. This configuration specifies the default encryption settings that will be applied to all tables created in this bucket unless overridden at the table level. The configuration includes the encryption algorithm and, if using SSE-KMS, the KMS key to use.

  • storage_class_configuration (Optional[StorageClassConfiguration], default: None ) –

    The default storage class configuration for the table bucket. This configuration will be applied to all new tables created in this bucket unless overridden at the table level. If not specified, the service default storage class will be used.

  • tags (Optional[Tags], default: None ) –

    A map of user-defined tags that you would like to apply to the table bucket that you are creating. A tag is a key-value pair that you apply to your resources. Tags can help you organize and control access to resources. For more information, see Tagging for cost allocation or attribute-based access control (ABAC).

    You must have the s3tables:TagResource permission in addition to s3tables:CreateTableBucket permisson to create a table bucket with tags.

Raises:

Source code in docs_src/capo_s3tables/_services/async_s3_tables.py
async def create_table_bucket(
    self,
    name: "capo_s3tables.types.table_bucket_name.TableBucketName",
    *,
    config_overrides: Optional[AsyncS3TablesClientConfig] = None,
    encryption_configuration: Optional[
        "capo_s3tables.types.encryption_configuration.EncryptionConfiguration"
    ] = None,
    storage_class_configuration: Optional[
        "capo_s3tables.types.storage_class_configuration.StorageClassConfiguration"
    ] = None,
    tags: Optional["capo_s3tables.types.tags.Tags"] = None,
) -> "capo_s3tables.types.create_table_bucket_response.CreateTableBucketResponse":
    """<p>Creates a table bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-create.html">Creating a table bucket</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p> <dl> <dt>Permissions</dt> <dd> <ul> <li> <p>You must have the <code>s3tables:CreateTableBucket</code> permission to use this operation. </p> </li> <li> <p>If you use this operation with the optional <code>encryptionConfiguration</code> parameter you must have the <code>s3tables:PutTableBucketEncryption</code> permission.</p> </li> <li> <p>If you use this operation with the <code>storageClassConfiguration</code> request parameter, you must have the <code>s3tables:PutTableBucketStorageClass</code> permission.</p> </li> <li> <p>To create a table bucket with tags, you must have the <code>s3tables:TagResource</code> permission in addition to <code>s3tables:CreateTableBucket</code> permission.</p> </li> </ul> </dd> </dl>

    Args:
        name: <p>The name for the table bucket.</p>
        encryption_configuration: <p>The encryption configuration to use for the table bucket. This configuration specifies the default encryption settings that will be applied to all tables created in this bucket unless overridden at the table level. The configuration includes the encryption algorithm and, if using SSE-KMS, the KMS key to use.</p>
        storage_class_configuration: <p>The default storage class configuration for the table bucket. This configuration will be applied to all new tables created in this bucket unless overridden at the table level. If not specified, the service default storage class will be used.</p>
        tags: <p>A map of user-defined tags that you would like to apply to the table bucket that you are creating. A tag is a key-value pair that you apply to your resources. Tags can help you organize and control access to resources. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/tagging.html">Tagging for cost allocation or attribute-based access control (ABAC)</a>.</p> <note> <p>You must have the <code>s3tables:TagResource</code> permission in addition to <code>s3tables:CreateTableBucket</code> permisson to create a table bucket with tags.</p> </note>

    Raises:
        capo_s3tables.errors.bad_request_exception.BadRequestException: <p>The request is invalid or malformed.</p>
        capo_s3tables.errors.conflict_exception.ConflictException: <p>The request failed because there is a conflict with a previous write. You can retry the request.</p>
        capo_s3tables.errors.forbidden_exception.ForbiddenException: <p>The caller isn't authorized to make the request.</p>
        capo_s3tables.errors.internal_server_error_exception.InternalServerErrorException: <p>The request failed due to an internal server error.</p>
        capo_s3tables.errors.not_found_exception.NotFoundException: <p>The request was rejected because the specified resource could not be found.</p>
        capo_s3tables.errors.too_many_requests_exception.TooManyRequestsException: <p>The limit on the number of requests per second was exceeded.</p>
        capo_s3tables.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_s3tables.types.create_table_bucket_request.CreateTableBucketRequest]",
    ) -> AsyncOperationResponse[
        "capo_s3tables.types.create_table_bucket_response.CreateTableBucketResponse"
    ]:
        import capo_s3tables._operations.s3_table_buckets.create_table_bucket

        (
            output,
            http_response,
        ) = await capo_s3tables._operations.s3_table_buckets.create_table_bucket.async_create_table_bucket(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateTableBucket")
    )
    input_: capo_s3tables.types.create_table_bucket_request.CreateTableBucketRequest = {
        "name": name
    }
    if encryption_configuration is not None:
        input_["encryption_configuration"] = encryption_configuration
    if storage_class_configuration is not None:
        input_["storage_class_configuration"] = storage_class_configuration
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output