I tried to inventory AWS Gov Cloud regions using this tool, however, the tool was not recognizing US GovCloud regions of (us-gov-east-1 and us-gov-west-1).
The problem stems from get_available_regions() call on the session object. By default, it only returns AWS public regions. In order for it to return GovCloud regions (or for that matter China regions), a second argument named partition_name has to be passed in for boto3 to return GovCloud regions list.
I made the brute force change below to get this tool to work with GovCloud accounts.
Modified File: aws-inventory.py
Changed the following line from:
available_regions = frozenset(boto_session.get_available_regions(svc_name))
to:
available_regions = frozenset(boto_session.get_available_regions(svc_name, 'aws-us-gov'))
Similar type of change will be needed to inventory accounts that have resources in AWS China regions.
Thanks.
Khalid
I tried to inventory AWS Gov Cloud regions using this tool, however, the tool was not recognizing US GovCloud regions of (us-gov-east-1 and us-gov-west-1).
The problem stems from get_available_regions() call on the session object. By default, it only returns AWS public regions. In order for it to return GovCloud regions (or for that matter China regions), a second argument named partition_name has to be passed in for boto3 to return GovCloud regions list.
I made the brute force change below to get this tool to work with GovCloud accounts.
Modified File: aws-inventory.py
Changed the following line from:
available_regions = frozenset(boto_session.get_available_regions(svc_name))
to:
available_regions = frozenset(boto_session.get_available_regions(svc_name, 'aws-us-gov'))
Similar type of change will be needed to inventory accounts that have resources in AWS China regions.
Thanks.
Khalid