Skip to main content

Get multi-region details from AWS Organizations accounts.

Project description

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

Project details


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.1.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.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for get_aws_details-1.1.0.tar.gz
Algorithm Hash digest
SHA256 a6cb42c89e3b2a9d79681b670599b6113712a658fbd61ce6a3c99dccc2f637f8
MD5 82b26b10b94b7096613ba28ad56b2e69
BLAKE2b-256 989e39aed8c81bf3e32ac6a1eea5d48a2bd5fa338189225f2d53c58ceb8aa0f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: get_aws_details-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/5.15.154+

File hashes

Hashes for get_aws_details-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aebd91a4dabb7443d6a778a698e4f4df43a4bfb7681169799b902894fc2dbc1c
MD5 55128174a9748b6179169d5e58bc83e0
BLAKE2b-256 a6ae1f9399a4e84580c62102ca5700cc544f0a45b3d5d3de81b4be568f5595b9

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 Pingdom Monitoring Sentry Error logging StatusPage Status page