06-delete-table.py
O programa 06-delete-table.py
exclui TryDaxTable
. Execute esse programa depois de concluir o teste de funcionalidade do Amazon DynamoDB Accelerator (DAX).
import boto3 def delete_dax_table(dyn_resource=None): """ Deletes the demonstration table. :param dyn_resource: Either a Boto3 or DAX resource. """ if dyn_resource is None: dyn_resource = boto3.resource("dynamodb") table = dyn_resource.Table("TryDaxTable") table.delete() print(f"Deleting {table.name}...") table.wait_until_not_exists() if __name__ == "__main__": delete_dax_table() print("Table deleted!")