feat: add billing mode to aws-ddb.py

This commit is contained in:
KenF
2026-01-29 14:41:54 +08:00
parent 67774d64db
commit af84089121
+2 -2
View File
@@ -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: