Skip to content

runbooks inventory list-resource-groupsΒΆ

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

Usage: runbooks inventory list-resource-groups [OPTIONS]

  List AWS Resource Groups in the specified region.

  Uses $AWS_OPERATIONS_PROFILE by default (Resource Groups is account-scoped,
  not org-scoped β€” uses centralised-ops account per profile semantics). Empty
  Groups array is a valid result.

  Exit codes: 0=success, 1=AWS auth/permission error, 2=unexpected error.

  Examples:     runbooks inventory list-resource-groups --profile
  $AWS_OPERATIONS_PROFILE     runbooks inventory list-resource-groups
  --profile $AWS_OPERATIONS_PROFILE \         --region ap-southeast-2
  --output-dir tenants/b2b-energy/raw/organizations/

Options:
  --profile TEXT          Operations account profile (defaults to
                          $AWS_OPERATIONS_PROFILE β€” Resource Groups is
                          account-scoped).
  --region TEXT           AWS region (Resource Groups is region-scoped;
                          required).
  --json                  Print results as JSON to stdout.
  --output-dir DIRECTORY  Write resource-groups.json to this directory.
  --help                  Show this message and exit.

Run All β€” refresh resource-groups inventory for the centralised-ops accountΒΆ

# Prerequisites: export AWS_OPERATIONS_PROFILE pointing to the centralised-ops account
set -a; source .env; set +a

# Resolve the account slug at runtime (per CC-ORG-009 Flag 1 β€” no hardcoding):
ACCOUNT_SLUG=$(uv run python -c "from runbooks.inventory._account_name_resolver import resolve_account_name; print(resolve_account_name('$AWS_OPERATIONS_PROFILE'))")
OUT="tenants/b2b-energy/raw/accounts/${ACCOUNT_SLUG}"
mkdir -p "$OUT"

# READONLY discovery: resource-groups is a per-account, regional API
uv run runbooks inventory list-resource-groups --all-profile $AWS_OPERATIONS_PROFILE --output-dir "$OUT"

Output: tenants/b2b-energy/raw/accounts/<centralised-ops>/resource-groups.{json,csv,md}

ExamplesΒΆ