Skip to content

does not inventory gov cloud regions #20

Description

@khyberkanwar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions