update_table
¶
update_table(
table_name: TableArn,
*,
config_overrides: Optional[DynamoDBClientConfig] = None,
attribute_definitions: Optional[AttributeDefinitions] = None,
billing_mode: Optional[BillingMode] = None,
provisioned_throughput: Optional[ProvisionedThroughput] = None,
global_secondary_index_updates: Optional[GlobalSecondaryIndexUpdateList] = None,
stream_specification: Optional[StreamSpecification] = None,
sse_specification: Optional[SSESpecification] = None,
replica_updates: Optional[ReplicationGroupUpdateList] = None,
table_class: Optional[TableClass] = None,
deletion_protection_enabled: Optional[DeletionProtectionEnabled] = None,
multi_region_consistency: Optional[MultiRegionConsistency] = None,
global_table_witness_updates: Optional[GlobalTableWitnessGroupUpdateList] = None,
on_demand_throughput: Optional[OnDemandThroughput] = None,
warm_throughput: Optional[WarmThroughput] = None,
global_table_settings_replication_mode: Optional[
GlobalTableSettingsReplicationMode
] = None,
vector_index_updates: Optional[VectorIndexUpdateList] = None,
) -> UpdateTableOutput
Modifies the provisioned throughput settings, global secondary indexes, or DynamoDB Streams settings for a given table.
You can only perform one of the following operations at once:
-
Modify the provisioned throughput settings of the table.
-
Remove a global secondary index from the table.
-
Create a new global secondary index on the table. After the index begins backfilling, you can use
UpdateTableto perform other operations.
UpdateTable is an asynchronous operation; while it's executing, the table status changes from ACTIVE to UPDATING. While it's UPDATING, you can't issue another UpdateTable request. When the table returns to the ACTIVE state, the UpdateTable operation is complete.
Parameters:
-
attribute_definitions(Optional[AttributeDefinitions], default:None) –An array of attributes that describe the key schema for the table and indexes. If you are adding a new global secondary index to the table,
AttributeDefinitionsmust include the key element(s) of the new index. -
table_name(TableArn) –The name of the table to be updated. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
-
billing_mode(Optional[BillingMode], default:None) –Controls how you are charged for read and write throughput and how you manage capacity. When switching from pay-per-request to provisioned capacity, initial provisioned capacity values must be set. The initial provisioned capacity values are estimated based on the consumed read and write capacity of your table and global secondary indexes over the past 30 minutes.
-
PAY_PER_REQUEST- We recommend usingPAY_PER_REQUESTfor most DynamoDB workloads.PAY_PER_REQUESTsets the billing mode to On-demand capacity mode. -
PROVISIONED- We recommend usingPROVISIONEDfor steady workloads with predictable growth where capacity requirements can be reliably forecasted.PROVISIONEDsets the billing mode to Provisioned capacity mode.
-
-
provisioned_throughput(Optional[ProvisionedThroughput], default:None) –The new provisioned throughput settings for the specified table or index.
-
global_secondary_index_updates(Optional[GlobalSecondaryIndexUpdateList], default:None) –An array of one or more global secondary indexes for the table. For each index in the array, you can request one action:
-
Create- add a new global secondary index to the table. -
Update- modify the provisioned throughput settings of an existing global secondary index. -
Delete- remove a global secondary index from the table.
You can create or delete only one global secondary index per
UpdateTableoperation.For more information, see Managing Global Secondary Indexes in the Amazon DynamoDB Developer Guide.
-
-
stream_specification(Optional[StreamSpecification], default:None) –Represents the DynamoDB Streams configuration for the table.
You receive a
ValidationExceptionif you try to enable a stream on a table that already has a stream, or if you try to disable a stream on a table that doesn't have a stream. -
sse_specification(Optional[SSESpecification], default:None) –The new server-side encryption settings for the specified table.
-
replica_updates(Optional[ReplicationGroupUpdateList], default:None) –A list of replica update actions (create, delete, or update) for the table.
-
table_class(Optional[TableClass], default:None) –The table class of the table to be updated. Valid values are
STANDARDandSTANDARD_INFREQUENT_ACCESS. -
deletion_protection_enabled(Optional[DeletionProtectionEnabled], default:None) –Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.
-
multi_region_consistency(Optional[MultiRegionConsistency], default:None) –Specifies the consistency mode for a new global table. This parameter is only valid when you create a global table by specifying one or more Create actions in the ReplicaUpdates action list.
You can specify one of the following consistency modes:
-
EVENTUAL: Configures a new global table for multi-Region eventual consistency (MREC). This is the default consistency mode for global tables. -
STRONG: Configures a new global table for multi-Region strong consistency (MRSC).
If you don't specify this field, the global table consistency mode defaults to
EVENTUAL. For more information about global tables consistency modes, see Consistency modes in DynamoDB developer guide. -
-
global_table_witness_updates(Optional[GlobalTableWitnessGroupUpdateList], default:None) –A list of witness updates for a MRSC global table. A witness provides a cost-effective alternative to a full replica in a MRSC global table by maintaining replicated change data written to global table replicas. You cannot perform read or write operations on a witness. For each witness, you can request one action:
-
Create- add a new witness to the global table. -
Delete- remove a witness from the global table.
You can create or delete only one witness per
UpdateTableoperation.For more information, see Multi-Region strong consistency (MRSC) in the Amazon DynamoDB Developer Guide
-
-
on_demand_throughput(Optional[OnDemandThroughput], default:None) –Updates the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this parameter, you must specify
MaxReadRequestUnits,MaxWriteRequestUnits, or both. -
warm_throughput(Optional[WarmThroughput], default:None) –Represents the warm throughput (in read units per second and write units per second) for updating a table.
-
global_table_settings_replication_mode(Optional[GlobalTableSettingsReplicationMode], default:None) –Controls the settings replication mode for a global table replica. This attribute can be defined using UpdateTable operation only on a regional table with values:
-
ENABLED: Defines settings replication on a regional table to be used as a source table for creating Multi-Account Global Table. -
DISABLED: Remove settings replication on a regional table. Settings replication needs to be defined to ENABLED again in order to create a Multi-Account Global Table using this table.
-
-
vector_index_updates(Optional[VectorIndexUpdateList], default:None) –A list of vector indexes to be added to or removed from the table. You can add or remove one vector index for each
UpdateTableoperation.To add a vector index, specify
IndexName,VectorAttribute,Dimensions,DistanceFunction, andProjection. To remove a vector index, specify only theIndexName.
Raises:
-
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, andRestoreTableToPointInTime.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
CREATINGstate. -
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/dynamo_db.py
4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 | |