feat: added account id to workbook title
This commit is contained in:
+7
-1
@@ -8,12 +8,18 @@ License: This program is released under the MIT License
|
|||||||
# Imports
|
# Imports
|
||||||
from openpyxl import Workbook
|
from openpyxl import Workbook
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
import boto3
|
||||||
|
|
||||||
|
|
||||||
# Main function
|
# Main function
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
|
client = boto3.client('sts')
|
||||||
|
response = client.get_caller_identity()
|
||||||
|
accountId = response['Account']
|
||||||
|
|
||||||
wb = Workbook()
|
wb = Workbook()
|
||||||
ws = wb.active
|
ws = wb.active
|
||||||
ws['A1'] = "AWS Inventory"
|
ws['A1'] = f"AWS Inventory for {accountId}"
|
||||||
ws['A2'] = "Created on"
|
ws['A2'] = "Created on"
|
||||||
ws['B2'] = datetime.now()
|
ws['B2'] = datetime.now()
|
||||||
wb.save('aws-inventory.xlsx')
|
wb.save('aws-inventory.xlsx')
|
||||||
|
|||||||
Reference in New Issue
Block a user