Skip to content

runbooks inventory enrich-accountsΒΆ

Auto-generated from runbooks inventory enrich-accounts --help on 2026-05-21. Source of truth: runbooks PyPI package v1.3.22

Usage: runbooks inventory enrich-accounts [OPTIONS]

  Enrich resources with AWS Organizations account metadata.

  Adds 7 columns: account_name, account_email, wbs_code, cost_group,
  technical_lead, account_owner, organizational_unit.

  πŸ”‘ Profile Requirements:   --profile: MANAGEMENT profile with Organizations
  API permissions

    Required IAM permissions:     - organizations:ListAccounts (minimum)     -
    organizations:DescribeOrganization     - organizations:ListTagsForResource

    See ~/.aws/config for available profiles.

  πŸ’‘ Common Workflows:   Discovery β†’ Organizations:     runbooks inventory
  resource-explorer --resource-type ec2 --output /tmp/ec2.csv     runbooks
  inventory enrich-accounts --input /tmp/ec2.csv --profile MANAGEMENT

  Enterprise Features: - Multi-format export (--export for CSV/JSON/Markdown)
  - Account filtering (--accounts to enrich specific accounts only) - Tag-
  based filtering (--tags to filter resources before enrichment)

  Examples:     # Single profile enrichment (5-layer pipeline: Layer 2)
  runbooks inventory enrich-accounts \       --input /tmp/discovered-
  resources.csv \       --profile ${MANAGEMENT_PROFILE} \       --output
  /tmp/resources-with-accounts.csv

      # Multi-format export     runbooks inventory enrich-accounts \
      --input /tmp/discovered-resources.csv \       --profile my-profile
      --export --output-dir ./data/outputs \       --output /tmp/resources-
      with-accounts.csv

      # Filter specific accounts before enrichment     runbooks inventory
      enrich-accounts \       --input /tmp/discovered-resources.csv \
      --profile my-profile --accounts 123456789012 \       --output
      /tmp/resources-with-accounts.csv

Options:
  --tags TEXT                     Filter by tags (key=value format)
  --accounts TEXT                 Filter by specific account IDs
  --all                           Multi-account discovery
                                  (CENTRALISED_OPS_PROFILE as aggregator).

                                  πŸ“‹ Behavior: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                  ━━━━━━━━━━━━━━━

                                  β€’ Queries AWS Resource Explorer aggregator
                                  index β€’ Discovers resources across ALL
                                  accounts in Landing Zone β€’ Requires
                                  CENTRALISED_OPS_PROFILE with cross-account
                                  permissions

                                  πŸ” Enrichment Layers (Automatic):   β€’
                                  Organizations metadata: MANAGEMENT_PROFILE
                                  β€’ Cost data: BILLING_PROFILE   Note:
                                  Enrichment uses separate profiles regardless
                                  of discovery mode

                                  Use Case: Enterprise platform teams managing
                                  67+ account Landing Zones
  --profiles TEXT                 Specific AWS profiles (comma-separated,
                                  e.g., "billing,security,audit")
  --regions TEXT                  Specific AWS regions (space-separated)
  --all-regions                   Process all enabled AWS regions
  -f, --format, --output-format [json|csv|table|pdf|markdown]
                                  Output format for results display
                                  (-f/--format preferred, --output-format
                                  legacy)
  --output-dir PATH               Directory for generated files and evidence
                                  packages
  --all-outputs                   Generate all output formats (JSON, CSV, PDF,
                                  Markdown) - use with --output-dir
  --csv                           Export to CSV format (convenience flag,
                                  activates --all-outputs)
  --json                          Export to JSON format (convenience flag,
                                  activates --all-outputs)
  --markdown                      Export to Markdown format (convenience flag,
                                  activates --all-outputs)
  --profile TEXT                  AWS profile for single-account operations.

                                  πŸ“‹ Profile Selection Guide: ━━━━━━━━━━━━━━━━━
                                  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

                                  Single Account β†’ Use --profile YOUR_PROFILE
                                  Example: --profile dev-account   When:
                                  Developer/operator working in one AWS
                                  account

                                  Multi-Account LZ β†’ Use --all-profiles (see
                                  inventory commands)   Example: --all-
                                  profiles   When: Platform team discovering
                                  across organization

                                  πŸ” Enrichment Profiles (Automatic):   β€’
                                  Organizations: MANAGEMENT_PROFILE   β€’ Costs:
                                  BILLING_PROFILE   Note: Separate from
                                  discovery profile

                                  Decision: Single account = --profile |
                                  Multi-account = --all-profiles
  --region TEXT                   AWS region override (default: ap-
                                  southeast-2)
  --dry-run                       Safe analysis mode - no resource
                                  modifications (enterprise default)
  --input PATH                    Input CSV from resource-explorer  [required]
  --output PATH                   Output CSV path  [required]
  --console-format                Display Rich table to console AND export CSV
                                  (dual output)
  -v, --verbose                   Show detailed execution logs
  --format-output [compact|table|json]
                                  Output format (renamed from --format to
                                  avoid conflict)
  --help                          Show this message and exit.

ExamplesΒΆ