Skip to content

Commit

Permalink
Warn on large table in aws-dynamodb-truncate
Browse files Browse the repository at this point in the history
Trigger this after 100,000 items.
  • Loading branch information
corpulentcoffee committed Mar 6, 2021
1 parent 0c21c67 commit 11e6a47
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions home/bin/aws_dynamodb_truncate.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ def get_confirmation(
if item_count > 0
else "An estimate for the item count of this table is not available."
)
if item_count >= 100_000:
estimate += (
" For a table of this size, consider deleting and recreating it "
"as a faster and cheaper alternative."
)

prompt = f"""
All items from {table_name} will be deleted.
Expand Down

0 comments on commit 11e6a47

Please sign in to comment.