Skip to main content

Overview

Get multi-region details from AWS Organizations accounts.

This module helps to retrieve AWS details from multiple Organizations accounts and regions. It features the following capabilities:

  • SSO authentication

  • Pagination (see caveat)

  • Multithreading (requires a cross-account role to assume)

  • CSV output

  • Account filtering by status, Organizational Unit, or list (in this order of precedence)

Caveat

Works with paginated AWS service commands only.

Usage

  • Installation:

pip3 install get_aws_details
# or
python3 -m pip install get_aws_details
  • Command example:

# Overview.
aws_details -h

# Get all VPC primary CIDR blocks.
aws_details \
   -a 123456789012 \
   -u https://my-sso-portal.awsapps.com/start/#/ \
   -r MySSORoleName \
   -n MyAssumedRoleName \
   -s ACTIVE \
   -g ALL \
   -v ec2 \
   -p Vpcs \
   -c describe_vpcs \
   -k vpc_id=VpcId is_default=IsDefault cidr_block=CidrBlock
  • Output example:

vpc_id,is_default,cidr_block,account_id,region
vpc-0a1b2c3d4e5f6g7h,True,10.0.0.0/16,123456789012,us-east-1
vpc-321asd4f5g6h7j8k,False,192.168.1.0/24,987654321098,ap-southeast-3

Arguments

  • Required:

-a, --sso_account_id SSO_ACCOUNT_ID
                        SSO Account ID.
-u, --sso_url SSO_URL
                        SSO URL.
-r, --sso_role_name SSO_ROLE_NAME
                        SSO Role Name.
-v, --service SERVICE
                        AWS service to query (example: ec2).
-p, --page_key PAGE_KEY
                        Pagination key for the AWS service response (example: Vpcs).
-c, --command COMMAND
                        AWS service command to execute (example: describe_vpcs).
  • Conditional:

-n, --assumed_role_name [ASSUMED_ROLE_NAME]
                        Assumed Role Name (default: None).
-e, --external_id [EXTERNAL_ID]
                        External ID for assumed role (default: None).
-s, --account_statuses [ACCOUNT_STATUSES]
                        Comma-separated account statuses to filter (default: None).
-o, --account_ou [ACCOUNT_OU]
                        Account Organizational Unit to filter (default: None).
-l, --account_list [ACCOUNT_LIST]
                        Comma-separated list of account IDs to filter (default: None).
-k, --kvps KVPS [KVPS ...]
                        Key-value pairs for CSV output (format: key=value).
-i, --filters [FILTERS ...]
                        Filters for AWS service query (format: Name=Values).
  • Optional:

-h, --help            show this help message and exit
-V, --version         show program's version number and exit
-t, --thread_num [THREAD_NUM]
                        Number of threads to use for multithreading (default: 10).
-f, --output_file [OUTPUT_FILE]
                        Path to the output CSV file (default: aws_details.csv).
-g, --region REGION   Region to query (example: us-east-1 or ALL for all regions, default: ALL).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

get_aws_details-1.2.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

get_aws_details-1.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file get_aws_details-1.2.0.tar.gz.

File metadata

  • Download URL: get_aws_details-1.2.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.14.4 Linux/5.15.154+

File hashes

Hashes for get_aws_details-1.2.0.tar.gz
Algorithm Hash digest
SHA256 7270cc721eec43fd0c3522849391b6831e084a0dbeccd8d7895b1b142eea95e9
MD5 7b976db64617650e07f2595d405dd737
BLAKE2b-256 a1f17923443a74320caf5cc3d4d250e68b7c3099d96d5f70fc9d141b11e3f6ce

See more details on using hashes here.

File details

Details for the file get_aws_details-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: get_aws_details-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.14.4 Linux/5.15.154+

File hashes

Hashes for get_aws_details-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3cfcb2a5dc3a47221badacd62443915f07c2f8203adce9c7cea8278a0934bdca
MD5 0da6325d414b7b593da3fe9bd52964b3
BLAKE2b-256 4cf4168a33d2a8a6fa3c99aba82e76d8aa0ef8376f13d4ca66db50195ae80dd7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page