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:
|
for t in table_names:
|
||||||
resp2 = client.describe_table(TableName=t)
|
resp2 = client.describe_table(TableName=t)
|
||||||
i = resp2['Table']
|
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
|
return return_data
|
||||||
|
|
||||||
# Main function
|
# Main function
|
||||||
@@ -30,7 +30,7 @@ def main() -> None:
|
|||||||
wb = load_workbook('aws-inventory.xlsx')
|
wb = load_workbook('aws-inventory.xlsx')
|
||||||
ws = wb.create_sheet("DynamoDB")
|
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:
|
with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor:
|
||||||
results = executor.map(getResources, projectlib.aws.getRegions())
|
results = executor.map(getResources, projectlib.aws.getRegions())
|
||||||
for region_rows in results:
|
for region_rows in results:
|
||||||
|
|||||||
Reference in New Issue
Block a user