feat: add billing mode to aws-ddb.py
This commit is contained in:
+2
-2
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user