From af84089121d33954558219dd16f06fa1bdc37f63 Mon Sep 17 00:00:00 2001 From: KenF Date: Thu, 29 Jan 2026 14:41:54 +0800 Subject: [PATCH] feat: add billing mode to aws-ddb.py --- aws-ddb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws-ddb.py b/aws-ddb.py index 16d1e8d..f565cd0 100755 --- a/aws-ddb.py +++ b/aws-ddb.py @@ -21,7 +21,7 @@ def getResources(region_name: str) -> list[list[str | int]]: for t in table_names: resp2 = client.describe_table(TableName=t) i = resp2['Table'] - return_data.append([i['TableName'], i['TableStatus'], i['TableSizeBytes'], i['ItemCount'], region_name]) + return_data.append([i['TableName'], i['TableStatus'], i['TableSizeBytes'], i['ItemCount'], i['BillingModeSummary']['BillingMode'], region_name]) return return_data # Main function @@ -30,7 +30,7 @@ def main() -> None: wb = load_workbook('aws-inventory.xlsx') ws = wb.create_sheet("DynamoDB") - ws.append(["TableName", "TableStatus", "TableSizeBytes", "ItemCount", "Region"]) + ws.append(["TableName", "TableStatus", "TableSizeBytes", "ItemCount", "BillingMode", "Region"]) with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor: results = executor.map(getResources, projectlib.aws.getRegions()) for region_rows in results: