Skip to content

update_global_table_settings

update_global_table_settings(
    global_table_name: TableName,
    *,
    config_overrides: Optional[DynamoDBClientConfig] = None,
    global_table_billing_mode: Optional[BillingMode] = None,
    global_table_provisioned_write_capacity_units: Optional[PositiveLongObject] = None,
    global_table_provisioned_write_capacity_auto_scaling_settings_update: Optional[
        AutoScalingSettingsUpdate
    ] = None,
    global_table_global_secondary_index_settings_update: Optional[
        GlobalTableGlobalSecondaryIndexSettingsUpdateList
    ] = None,
    replica_settings_update: Optional[ReplicaSettingsUpdateList] = None,
) -> UpdateGlobalTableSettingsOutput

Updates settings for a global table.

This documentation is for version 2017.11.29 (Legacy) of global tables, which should be avoided for new global tables. Customers should use Global Tables version 2019.11.21 (Current) when possible, because it provides greater flexibility, higher efficiency, and consumes less write capacity than 2017.11.29 (Legacy).

To determine which version you're using, see Determining the global table version you are using. To update existing global tables from version 2017.11.29 (Legacy) to version 2019.11.21 (Current), see Upgrading global tables.

Parameters:

  • global_table_name (TableName) –

    The name of the global table

  • global_table_billing_mode (Optional[BillingMode], default: None ) –

    The billing mode of the global table. If GlobalTableBillingMode is not specified, the global table defaults to PROVISIONED capacity billing mode.

    • PROVISIONED - We recommend using PROVISIONED for predictable workloads. PROVISIONED sets the billing mode to Provisioned capacity mode.

    • PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable workloads. PAY_PER_REQUEST sets the billing mode to On-demand capacity mode.

  • global_table_provisioned_write_capacity_units (Optional[PositiveLongObject], default: None ) –

    The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException.

  • global_table_provisioned_write_capacity_auto_scaling_settings_update (Optional[AutoScalingSettingsUpdate], default: None ) –

    Auto scaling settings for managing provisioned write capacity for the global table.

  • global_table_global_secondary_index_settings_update (Optional[GlobalTableGlobalSecondaryIndexSettingsUpdateList], default: None ) –

    Represents the settings of a global secondary index for a global table that will be modified.

  • replica_settings_update (Optional[ReplicaSettingsUpdateList], default: None ) –

    Represents the settings for a global table in a Region that will be modified.

Raises:

  • GlobalTableNotFoundException –

    The specified global table does not exist.

  • IndexNotFoundException –

    The operation tried to access a nonexistent index.

  • InternalServerError –

    An error occurred on the server side.

  • 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.

  • ReplicaNotFoundException –

    The specified replica is no longer part of the global table.

  • 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.

  • UnknownServiceError –

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

Source code in docs_src/capo_dynamodb/_services/dynamo_db.py
def update_global_table_settings(
    self,
    global_table_name: "capo_dynamodb.types.table_name.TableName",
    *,
    config_overrides: Optional[DynamoDBClientConfig] = None,
    global_table_billing_mode: Optional[
        "capo_dynamodb.types.billing_mode.BillingMode"
    ] = None,
    global_table_provisioned_write_capacity_units: Optional[
        "capo_dynamodb.types.positive_long_object.PositiveLongObject"
    ] = None,
    global_table_provisioned_write_capacity_auto_scaling_settings_update: Optional[
        "capo_dynamodb.types.auto_scaling_settings_update.AutoScalingSettingsUpdate"
    ] = None,
    global_table_global_secondary_index_settings_update: Optional[
        "capo_dynamodb.types.global_table_global_secondary_index_settings_update_list.GlobalTableGlobalSecondaryIndexSettingsUpdateList"
    ] = None,
    replica_settings_update: Optional[
        "capo_dynamodb.types.replica_settings_update_list.ReplicaSettingsUpdateList"
    ] = None,
) -> "capo_dynamodb.types.update_global_table_settings_output.UpdateGlobalTableSettingsOutput":
    """<p>Updates settings for a global table.</p> <important> <p>This documentation is for version 2017.11.29 (Legacy) of global tables, which should be avoided for new global tables. Customers should use <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GlobalTables.html">Global Tables version 2019.11.21 (Current)</a> when possible, because it provides greater flexibility, higher efficiency, and consumes less write capacity than 2017.11.29 (Legacy).</p> <p>To determine which version you're using, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.DetermineVersion.html">Determining the global table version you are using</a>. To update existing global tables from version 2017.11.29 (Legacy) to version 2019.11.21 (Current), see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_upgrade.html">Upgrading global tables</a>.</p> </important>

    Args:
        global_table_name: <p>The name of the global table</p>
        global_table_billing_mode: <p>The billing mode of the global table. If <code>GlobalTableBillingMode</code> is not specified, the global table defaults to <code>PROVISIONED</code> capacity billing mode.</p> <ul> <li> <p> <code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for predictable workloads. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a>.</p> </li> <li> <p> <code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html">On-demand capacity mode</a>. </p> </li> </ul>
        global_table_provisioned_write_capacity_units: <p>The maximum number of writes consumed per second before DynamoDB returns a <code>ThrottlingException.</code> </p>
        global_table_provisioned_write_capacity_auto_scaling_settings_update: <p>Auto scaling settings for managing provisioned write capacity for the global table.</p>
        global_table_global_secondary_index_settings_update: <p>Represents the settings of a global secondary index for a global table that will be modified.</p>
        replica_settings_update: <p>Represents the settings for a global table in a Region that will be modified.</p>

    Raises:
        capo_dynamodb.errors.global_table_not_found_exception.GlobalTableNotFoundException: <p>The specified global table does not exist.</p>
        capo_dynamodb.errors.index_not_found_exception.IndexNotFoundException: <p>The operation tried to access a nonexistent index.</p>
        capo_dynamodb.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</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.replica_not_found_exception.ReplicaNotFoundException: <p>The specified replica is no longer part of the global table.</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.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_dynamodb.types.update_global_table_settings_input.UpdateGlobalTableSettingsInput]",
    ) -> OperationResponse[
        "capo_dynamodb.types.update_global_table_settings_output.UpdateGlobalTableSettingsOutput"
    ]:
        import capo_dynamodb._operations.dynamo_db_20120810.update_global_table_settings

        output, http_response = (
            capo_dynamodb._operations.dynamo_db_20120810.update_global_table_settings.update_global_table_settings(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateGlobalTableSettings")
    )
    input_: capo_dynamodb.types.update_global_table_settings_input.UpdateGlobalTableSettingsInput = {
        "global_table_name": global_table_name
    }
    if global_table_billing_mode is not None:
        input_["global_table_billing_mode"] = global_table_billing_mode
    if global_table_provisioned_write_capacity_units is not None:
        input_["global_table_provisioned_write_capacity_units"] = (
            global_table_provisioned_write_capacity_units
        )
    if (
        global_table_provisioned_write_capacity_auto_scaling_settings_update
        is not None
    ):
        input_[
            "global_table_provisioned_write_capacity_auto_scaling_settings_update"
        ] = global_table_provisioned_write_capacity_auto_scaling_settings_update
    if global_table_global_secondary_index_settings_update is not None:
        input_["global_table_global_secondary_index_settings_update"] = (
            global_table_global_secondary_index_settings_update
        )
    if replica_settings_update is not None:
        input_["replica_settings_update"] = replica_settings_update

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output