(
    conn, table_name, read_capacity, write_capacity, wait=True
)
Update provisioned throughput on the table to provided values
Update provisioned throughput on the table to provided values
Update provisioned throughput on the table to provided values
def update_provisioned_throughput(
    conn, table_name, read_capacity, write_capacity, wait=True
):
    """
    Update provisioned throughput on the table to provided values
    """

    logging.info(
        "Updating "
        + table_name
        + " table read capacity to: "
        + str(read_capacity)
        + ", write capacity to: "
        + str(write_capacity)
    )
    while True:
        try:
            conn.update_table(
                TableName=table_name,
                ProvisionedThroughput={
                    "ReadCapacityUnits": int(read_capacity),
                    "WriteCapacityUnits": int(write_capacity),
                },
            )
            break
        except conn.exceptions.ResourceNotFoundException:
            logging.info(
                "Limit exceeded, retrying updating throughput of " + table_name + ".."
            )
            time.sleep(sleep_interval)
        except conn.exceptions.ProvisionedThroughputExceededException:
            logging.info(
                "Control plane limit exceeded, retrying updating throughput"
                "of " + table_name + ".."
            )
            time.sleep(sleep_interval)

    # wait for provisioned throughput update completion
    if wait:
        wait_for_active_table(conn, table_name, "updated")
def update_provisioned_throughput ( conn , table_name , read_capacity , write_capacity , wait = True ) : logging . info ( "Updating " + table_name + " table read capacity to: " + str ( read_capacity ) + ", write capacity to: " + str ( write_capacity ) ) while True : try : conn . update_table ( TableName = table_name , ProvisionedThroughput = { "ReadCapacityUnits" : int ( read_capacity ) , "WriteCapacityUnits" : int ( write_capacity ) , } , ) break except conn . exceptions . ResourceNotFoundException : logging . info ( "Limit exceeded, retrying updating throughput of " + table_name + ".." ) time . sleep ( sleep_interval ) except conn . exceptions . ProvisionedThroughputExceededException : logging . info ( "Control plane limit exceeded, retrying updating throughput" "of " + table_name + ".." ) time . sleep ( sleep_interval ) # wait for provisioned throughput update completion if wait : wait_for_active_table ( conn , table_name , "updated" )