Reputation: 2094
I am changing the table, for example the capacity settings using boto3 then I need to wait for its completation
I would prefer a solution using boto3.resource('dynamodb').Table('MyTable')
instead of dynamodb client.
Upvotes: 3
Views: 2690
Reputation: 2415
Try this to make your program wait until the Table Update is finished:
def table_status_checker(self):
while True:
table = self.__dynamodb.Table('table_name')
response = table.meta.client.describe_table(
TableName='table_name'
)
print(response['Table']['TableStatus'])
if response['Table']['TableStatus'] == 'ACTIVE':
break
There is small lag between Console UI and this describe_table(...).
Therefore, don't get confused with the Console UI Table Status.
Upvotes: 2