Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Doesn't work when run from linked accounts #22

Open
sidbose87 opened this issue Oct 2, 2019 · 1 comment
Open

Doesn't work when run from linked accounts #22

sidbose87 opened this issue Oct 2, 2019 · 1 comment

Comments

@sidbose87
Copy link

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.

@nikolaigauss
Copy link

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 :).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants