Skip to content

start_bulk_put_items async

start_bulk_put_items(
    input_s3_configuration: InputS3Configuration,
    output_s3_configuration: OutputS3Configuration,
    table_name: TableArn,
    *,
    config_overrides: Optional[AsyncDynamoDBClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    max_write_request_units: Optional[BulkOperationMaxWriteRequestUnits] = None,
    performance_tier: Optional[BulkOperationPerformanceTier] = None,
) -> StartBulkPutItemsOutput

Starts an asynchronous bulk operation that reads items from Amazon S3 and writes them to an existing DynamoDB table, so you can efficiently load or migrate large datasets.

Parameters:

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier that ensures the bulk operation starts no more than one time. During the 8 hours after the initial request, repeated requests that use the same token and parameters return the same bulk operation. If a request reuses the token with different parameters, DynamoDB returns an IdempotentParameterMismatchException. If you omit the token, an Amazon Web Services SDK automatically generates one.

  • input_s3_configuration (InputS3Configuration) –

    The Amazon S3 location, data format, and compression settings for the input objects.

  • output_s3_configuration (OutputS3Configuration) –

    The Amazon S3 location, encryption settings, and output types for the bulk operation.

  • table_name (TableArn) –

    The name or ARN of the existing DynamoDB table that receives the items.

  • max_write_request_units (Optional[BulkOperationMaxWriteRequestUnits], default: None ) –

    The maximum rate, in write request units per second, at which the bulk operation attempts to write. The value must be at least 1,024. With this setting, you limit only the bulk operation; the table's provisioned or on-demand capacity settings don't change. The actual write rate can be lower.

  • performance_tier (Optional[BulkOperationPerformanceTier], default: None ) –

    The performance tier for the bulk operation. Valid values are STANDARD and ACCELERATED. If you don't specify a value, the operation uses STANDARD.

Raises:

  • IdempotentParameterMismatchException –

    DynamoDB rejected the request because you retried a request with a different payload but with an idempotent token that was already used.

  • LimitExceededException –

    There is no limit to the number of daily on-demand backups that can be taken.

    For most purposes, up to 500 simultaneous table operations are allowed per account. These operations include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, and RestoreTableToPointInTime.

    When you are creating a table with one or more secondary indexes, you can have up to 250 such requests running at a time. However, if the table or index specifications are complex, then DynamoDB might temporarily reduce the number of concurrent operations.

    When importing into DynamoDB, up to 50 simultaneous import table operations are allowed per account.

    There is a soft account quota of 2,500 tables.

    GetRecords was called with a value of more than 1000 for the limit request parameter.

    More than 2 processes are reading from the same streams shard at the same time. Exceeding this limit may result in request throttling.

  • ResourceInUseException –

    The operation conflicts with the resource's availability. For example:

    • You attempted to recreate an existing table.

    • You tried to delete a table currently in the CREATING state.

    • You tried to update a resource that was already being updated.

    When appropriate, wait for the ongoing update to complete and attempt the request again.

  • ResourceNotFoundException –

    The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its status might not be ACTIVE.

  • UnknownServiceError –

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

Source code in docs_src/capo_dynamodb/_services/async_dynamo_db.py
async def start_bulk_put_items(
    self,
    input_s3_configuration: "capo_dynamodb.types.input_s3_configuration.InputS3Configuration",
    output_s3_configuration: "capo_dynamodb.types.output_s3_configuration.OutputS3Configuration",
    table_name: "capo_dynamodb.types.table_arn.TableArn",
    *,
    config_overrides: Optional[AsyncDynamoDBClientConfig] = None,
    client_token: Optional["capo_dynamodb.types.client_token.ClientToken"] = None,
    max_write_request_units: Optional[
        "capo_dynamodb.types.bulk_operation_max_write_request_units.BulkOperationMaxWriteRequestUnits"
    ] = None,
    performance_tier: Optional[
        "capo_dynamodb.types.bulk_operation_performance_tier.BulkOperationPerformanceTier"
    ] = None,
) -> "capo_dynamodb.types.start_bulk_put_items_output.StartBulkPutItemsOutput":
    """<p>Starts an asynchronous bulk operation that reads items from Amazon S3 and writes them to an existing DynamoDB table, so you can efficiently load or migrate large datasets.</p>

    Args:
        client_token: <p>A unique, case-sensitive identifier that ensures the bulk operation starts no more than one time. During the 8 hours after the initial request, repeated requests that use the same token and parameters return the same bulk operation. If a request reuses the token with different parameters, DynamoDB returns an <code>IdempotentParameterMismatchException</code>. If you omit the token, an Amazon Web Services SDK automatically generates one.</p>
        input_s3_configuration: <p>The Amazon S3 location, data format, and compression settings for the input objects.</p>
        output_s3_configuration: <p>The Amazon S3 location, encryption settings, and output types for the bulk operation.</p>
        table_name: <p>The name or ARN of the existing DynamoDB table that receives the items.</p>
        max_write_request_units: <p>The maximum rate, in write request units per second, at which the bulk operation attempts to write. The value must be at least 1,024. With this setting, you limit only the bulk operation; the table's provisioned or on-demand capacity settings don't change. The actual write rate can be lower.</p>
        performance_tier: <p>The performance tier for the bulk operation. Valid values are <code>STANDARD</code> and <code>ACCELERATED</code>. If you don't specify a value, the operation uses <code>STANDARD</code>.</p>

    Raises:
        capo_dynamodb.errors.idempotent_parameter_mismatch_exception.IdempotentParameterMismatchException: <p>DynamoDB rejected the request because you retried a request with a different payload but with an idempotent token that was already used.</p>
        capo_dynamodb.errors.invalid_endpoint_exception.InvalidEndpointException
        capo_dynamodb.errors.limit_exceeded_exception.LimitExceededException: <p>There is no limit to the number of daily on-demand backups that can be taken. </p> <p>For most purposes, up to 500 simultaneous table operations are allowed per account. These operations include <code>CreateTable</code>, <code>UpdateTable</code>, <code>DeleteTable</code>,<code>UpdateTimeToLive</code>, <code>RestoreTableFromBackup</code>, and <code>RestoreTableToPointInTime</code>. </p> <p>When you are creating a table with one or more secondary indexes, you can have up to 250 such requests running at a time. However, if the table or index specifications are complex, then DynamoDB might temporarily reduce the number of concurrent operations.</p> <p>When importing into DynamoDB, up to 50 simultaneous import table operations are allowed per account.</p> <p>There is a soft account quota of 2,500 tables.</p> <p>GetRecords was called with a value of more than 1000 for the limit request parameter.</p> <p>More than 2 processes are reading from the same streams shard at the same time. Exceeding this limit may result in request throttling.</p>
        capo_dynamodb.errors.resource_in_use_exception.ResourceInUseException: <p>The operation conflicts with the resource's availability. For example:</p> <ul> <li> <p>You attempted to recreate an existing table.</p> </li> <li> <p>You tried to delete a table currently in the <code>CREATING</code> state.</p> </li> <li> <p>You tried to update a resource that was already being updated.</p> </li> </ul> <p>When appropriate, wait for the ongoing update to complete and attempt the request again.</p>
        capo_dynamodb.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
        capo_dynamodb.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_dynamodb.types.start_bulk_put_items_input.StartBulkPutItemsInput]",
    ) -> AsyncOperationResponse[
        "capo_dynamodb.types.start_bulk_put_items_output.StartBulkPutItemsOutput"
    ]:
        import capo_dynamodb._operations.dynamo_db_20120810.start_bulk_put_items

        (
            output,
            http_response,
        ) = await capo_dynamodb._operations.dynamo_db_20120810.start_bulk_put_items.async_start_bulk_put_items(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartBulkPutItems")
    )
    input_: capo_dynamodb.types.start_bulk_put_items_input.StartBulkPutItemsInput = {
        "input_s3_configuration": input_s3_configuration,
        "output_s3_configuration": output_s3_configuration,
        "table_name": table_name,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if max_write_request_units is not None:
        input_["max_write_request_units"] = max_write_request_units
    if performance_tier is not None:
        input_["performance_tier"] = performance_tier

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