| Entry point | jobs/apim-key-rotation/main.py | Standalone CLI, calls run_rotation() |
| Settings | jobs/apim-key-rotation/rotation/config.py | Pydantic Settings — all env vars |
| Models | jobs/apim-key-rotation/rotation/models.py | RotationMetadata, RotationSummary, Slot enum |
| APIM SDK ops | jobs/apim-key-rotation/rotation/apim.py | Discover tenants, regenerate keys, verify APIM |
| Key Vault ops | jobs/apim-key-rotation/rotation/keyvault.py | Read/write metadata + keys in hub KV |
| Orchestrator | jobs/apim-key-rotation/rotation/runner.py | 7-step per-tenant rotation + run_rotation() entry |
| Dockerfile | jobs/apim-key-rotation/Dockerfile | Multi-stage: uv builder → Python slim runtime |
| Dependencies | jobs/apim-key-rotation/pyproject.toml | uv-managed deps (azure-*, pydantic, pydantic-settings) |
| Unit tests | jobs/apim-key-rotation/tests/ | pytest suite for models + runner logic |
| GHA workflow | .github/workflows/.builds.yml | Reusable workflow → GHCR image via bcgov/action-builder-ghcr (matrix entry) |
| Terraform module | infra-ai-hub/modules/key-rotation-function/ | Container App Job, RBAC assignments |
| Stack wiring | infra-ai-hub/stacks/key-rotation/main.tf | Calls module with feature flag gate |