How Can I Wait For A Dynamodb Update Table Or Active State Using Boto3
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('My
Solution 1:
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.
Post a Comment for "How Can I Wait For A Dynamodb Update Table Or Active State Using Boto3"