Expand description
Provider / account / region resolver (Phase 7, closes M4).
Per 16-provider-resolver.md. The resolver is the last transformation
before the exporter. It fills account_id / account_name / region on
every Resource and state_account_id /
state_region on every StateBackend, by
walking the provider alias → provider block → profile / assume-role /
cascade → external profile map chain documented in spec § 4.
§Public surface
ProviderResolver/DefaultProviderResolver: trait + default impl.ProviderContext: per-resolution context (profile map, default region, strict-mode flag).ProfileMap/ProfileEntry: the profile → account/region index.SharedProfileMap:ArcSwap<ProfileMap>alias for atomic re-loads.load_yaml_profile_map/load_aws_config/empty_profile_map: the three loaders mirroring spec § 3.extract_account_id: ARN → 12-digit account id helper (spec § 4.1).ProviderError: thiserror enum.
Structs§
- Default
Provider Resolver - Default implementation per spec § 4. Stateless.
- Profile
Entry - One entry in the
ProfileMap. - Profile
Map - Profile → entry index used by the provider resolver.
- Provider
Context - Per-resolution context —
Arc<ProfileMap>plus operator-driven flags.
Enums§
- Provider
Error - Errors raised by the provider-resolver layer.
Constants§
- AWS_
CONFIG_ MAX_ CHAIN_ HOPS - Spec 16 § 3.1: maximum
source_profilechain hop count. - PROFILE_
MAP_ FILE_ MAX_ BYTES - Spec 16 § 9: hard size cap for the source file (
~/.aws/configorprofile-map.yaml).
Traits§
- Provider
Resolver - Trait the orchestrator (Phase 9 CLI) calls. Phase 7 ships exactly one
implementation,
DefaultProviderResolver; downstream tests may swap in a stub.
Functions§
- empty_
profile_ map - Return an empty
ProfileMap(spec § 3.3noneloader). - extract_
account_ id - Parse an
arn:aws:iam::<12 digits>:role/<...>and return the 12-digit account id. ReturnsNonefor any other shape — includingassume_role-less providers and malformed ARNs. - load_
aws_ config - Load a profile map from
~/.aws/config(or any user-supplied INI-shaped file). - load_
yaml_ profile_ map - Load a profile map from a YAML file at
path. - shared
- Build a
SharedProfileMapseeded withinitial.
Type Aliases§
- Shared
Profile Map - Atomically-swappable handle for re-runs. Per CLAUDE.md § Async &
Concurrency:
ArcSwapfor infrequently-updated shared data; lock-free reads on the hot resolver path.