Skip to content

create_vector_bucket async

create_vector_bucket(
    vector_bucket_name: VectorBucketName,
    *,
    config_overrides: Optional[AsyncS3VectorsClientConfig] = None,
    encryption_configuration: Optional[EncryptionConfiguration] = None,
    tags: Optional[TagsMap] = None,
) -> CreateVectorBucketOutput

Creates a vector bucket in the Amazon Web Services Region that you want your bucket to be in.

Permissions

You must have the s3vectors:CreateVectorBucket permission to use this operation.

You must have the s3vectors:TagResource permission in addition to s3vectors:CreateVectorBucket permission to create a vector bucket with tags.

Parameters:

  • vector_bucket_name (VectorBucketName) –

    The name of the vector bucket to create.

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

    The encryption configuration for the vector bucket. By default, if you don't specify, all new vectors in Amazon S3 vector buckets use server-side encryption with Amazon S3 managed keys (SSE-S3), specifically AES256.

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

    An array of user-defined tags that you would like to apply to the vector 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 s3vectors:TagResource permission in addition to s3vectors:CreateVectorBucket permission to create a vector bucket with tags.

Raises:

  • AccessDeniedException –

    Access denied.

  • InternalServerException –

    The request failed due to an internal server error.

  • RequestTimeoutException –

    The request timed out. Retry your request.

  • TooManyRequestsException –

    The request was denied due to request throttling.

  • ValidationException –

    The requested action isn't valid.

  • ConflictException –

    The request failed because a vector bucket name or a vector index name already exists. Vector bucket names must be unique within your Amazon Web Services account for each Amazon Web Services Region. Vector index names must be unique within your vector bucket. Choose a different vector bucket name or vector index name, and try again.

  • ServiceQuotaExceededException –

    Your request exceeds a service quota.

  • ServiceUnavailableException –

    The service is unavailable. Wait briefly and retry your request. If it continues to fail, increase your waiting time between retries.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_s3vectors/_services/async_s3_vectors.py
async def create_vector_bucket(
    self,
    vector_bucket_name: "capo_s3vectors.types.vector_bucket_name.VectorBucketName",
    *,
    config_overrides: Optional[AsyncS3VectorsClientConfig] = None,
    encryption_configuration: Optional[
        "capo_s3vectors.types.encryption_configuration.EncryptionConfiguration"
    ] = None,
    tags: Optional["capo_s3vectors.types.tags_map.TagsMap"] = None,
) -> "capo_s3vectors.types.create_vector_bucket_output.CreateVectorBucketOutput":
    """<p>Creates a vector bucket in the Amazon Web Services Region that you want your bucket to be in. </p> <dl> <dt>Permissions</dt> <dd> <p>You must have the <code>s3vectors:CreateVectorBucket</code> permission to use this operation. </p> <p>You must have the <code>s3vectors:TagResource</code> permission in addition to <code>s3vectors:CreateVectorBucket</code> permission to create a vector bucket with tags.</p> </dd> </dl>

    Args:
        vector_bucket_name: <p>The name of the vector bucket to create. </p>
        encryption_configuration: <p>The encryption configuration for the vector bucket. By default, if you don't specify, all new vectors in Amazon S3 vector buckets use server-side encryption with Amazon S3 managed keys (SSE-S3), specifically <code>AES256</code>. </p>
        tags: <p>An array of user-defined tags that you would like to apply to the vector 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>s3vectors:TagResource</code> permission in addition to <code>s3vectors:CreateVectorBucket</code> permission to create a vector bucket with tags.</p> </note>

    Raises:
        capo_s3vectors.errors.access_denied_exception.AccessDeniedException: <p>Access denied.</p>
        capo_s3vectors.errors.internal_server_exception.InternalServerException: <p>The request failed due to an internal server error.</p>
        capo_s3vectors.errors.request_timeout_exception.RequestTimeoutException: <p>The request timed out. Retry your request.</p>
        capo_s3vectors.errors.too_many_requests_exception.TooManyRequestsException: <p>The request was denied due to request throttling.</p>
        capo_s3vectors.errors.validation_exception.ValidationException: <p>The requested action isn't valid.</p>
        capo_s3vectors.errors.conflict_exception.ConflictException: <p>The request failed because a vector bucket name or a vector index name already exists. Vector bucket names must be unique within your Amazon Web Services account for each Amazon Web Services Region. Vector index names must be unique within your vector bucket. Choose a different vector bucket name or vector index name, and try again.</p>
        capo_s3vectors.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Your request exceeds a service quota. </p>
        capo_s3vectors.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is unavailable. Wait briefly and retry your request. If it continues to fail, increase your waiting time between retries.</p>
        capo_s3vectors.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_s3vectors.types.create_vector_bucket_input.CreateVectorBucketInput]",
    ) -> AsyncOperationResponse[
        "capo_s3vectors.types.create_vector_bucket_output.CreateVectorBucketOutput"
    ]:
        import capo_s3vectors._operations.s3_vectors.create_vector_bucket

        (
            output,
            http_response,
        ) = await capo_s3vectors._operations.s3_vectors.create_vector_bucket.async_create_vector_bucket(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateVectorBucket")
    )
    input_: capo_s3vectors.types.create_vector_bucket_input.CreateVectorBucketInput = {
        "vector_bucket_name": vector_bucket_name
    }
    if encryption_configuration is not None:
        input_["encryption_configuration"] = encryption_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