Open sidbose87 opened 5 years ago
I've just done this:
self.accounts = {} #We don't have permission to list accounts in org so this is irrelevant
# try:
# self.accounts = self.getAccounts()
# except:
# logging.exception("Getting Account names failed")
# self.accounts = {}
# def getAccounts(self):
# accounts = {}
# client = boto3.client('organizations', region_name='us-east-1')
# paginator = client.get_paginator('list_accounts')
# response_iterator = paginator.paginate()
# for response in response_iterator:
# for acc in response['Accounts']:
# accounts[acc['Id']] = acc
# return accounts
But I had to deploy the report per each linked account, hope this helps :).
First of all, thanks for the code. I am looking for a cost & usage report for my linked account, I know aws doesn't support such reports for linked accounts, that is why I am looking for some kind of in house python code. I thought of working out the getAccounts module to change it use only my account ID. But doesn't seem to work.