5.1 Composition¶
AWSDeepInventoryCollector is a stack of mixins on top of AsyncAWSCollector:
class AWSDeepInventoryCollector(
GovernanceCollectorsMixin,
NetworkExtCollectorsMixin,
ApplicationCollectorsMixin,
DataMLCollectorsMixin,
IdentityCollectorsMixin,
ContainerCollectorsMixin,
ServerlessCollectorsMixin,
SecurityCollectorsMixin,
PlatformCollectorsMixin,
CloudControlCollectorsMixin,
AsyncAWSCollector,
): ...
Rules that follow from the MRO:
- Mixins come before
AsyncAWSCollector. A mixin's_collect_s3overrides the base collector's.AWSServiceMixindeclares_region,_account_idand_aio_configas annotations only; it must never define stubs forAsyncAWSCollectormethods, or it would shadow them. - Method names are global across all mixins. Two mixins defining the same helper silently
shadow each other (the one earlier in the MRO wins). Prefix package-private helpers (the
data/ML package uses
_dm_role_reffor that reason) and check withgrep -rn "def <name>" cloudg/inventory/aws_servicesbefore adding one. - Package mixins are themselves compositions (
ApplicationCollectorsMixincombines twelve per-area mixins), so each package keeps one place in the MRO.
Constructor: AWSDeepInventoryCollector(session, region="us-east-1", account_id=None,
tagging_sweep=True, **options). tagging_sweep stays the fourth positional parameter for
0.5.0 compatibility; every other option is keyword-only and validated by the
DeepInventoryOptions dataclass, so an unknown option name raises TypeError.
| Option | Default | Effect |
|---|---|---|
tagging_sweep |
True |
Run the Tagging API sweep. |
is_primary_region |
True |
Collect account-wide tasks here. |
services |
all | Families / task names to include. |
exclude_services |
none | Families / task names to skip (wins over services). |
kubernetes |
True |
Map in-cluster objects of EKS clusters. Also requires that kubernetes is not excluded and that all, kubernetes, containers or eks is selected. |
kubernetes_timeout |
10 |
Kubernetes API timeout, seconds. |
iam_resource_edges |
True |
Link principals to resources their identity policies name. |
max_images_per_repository |
20 |
ECR images sampled per repository (for tags, scan findings). |
stack_resources |
True |
Link CloudFormation stacks to their resources. |
cloud_control |
True |
Run the Cloud Control sweep. |
cloud_control_types |
all | Only these CloudFormation types or prefixes. |
cloud_control_exclude |
none | Skip these types or prefixes. |
cloud_control_concurrency |
6 |
Types listed in parallel per region. |