How aws-samples/service-screener-v2 works
Project type and purpose
• This is a full-stack, CLI-driven AWS guidance tool (“Service Screener”) written in Python.
• It runs in AWS CloudShell (or any Linux shell), invokes AWS APIs (via boto3/drivers) to gather resource configurations, evaluates them against best-practice rules, then generates a static HTML/JS report (using AdminLTE assets and Jinja-like templates).
• It also includes auxiliary “use cases” (cross-account scaffolding, scheduled runs via CDK/Lambda, etc.) but its core is a single CLI application with pluggable service modules and a presentation layer.
a. CLI “screener” entrypoint
• main.py, CreateService.py, Screener.py
• utils/ArguParser.py, utils/Config.py
b. Core Engine
• services/Service.py (Service manager)
• Evaluator.py (applies rules)
• PageBuilder.py (ties findings to frameworks)
• Reporter.py (orchestrates writing API JSON & HTML)
c. Service Modules
• services/{s3,ec2,iam,…}/X.py + their drivers/…
• Each service module invokes AWS SDK via a common driver interface
d. Frameworks (HTML page assembly)
• frameworks/Framework.py + per-framework maps & PageBuilder
e. Presentation layer
• templates/*.template.html
• adminlte/aws/res (CSS/JS assets)
f. Output
• output.zip → unzipped to index.html + static assets + per-account JSON (api-raw.json, api-full.json)
g. Utilities
• utils/ExcelBuilder.py, utils/RuleReader.py, utils/Tools.py
h. Optional Use Cases (external deployments)
• Cross-account role CFN template (usecases/crossAccounts)
• Scheduler CDK stack + Lambdas + DynamoDB/S3 triggers (usecases/scheduler)
1) User invokes CLI (main.py) with region/service flags
2) CLI parses args → loads Config → instantiates Screener
3) Screener iterates requested services:
→ Service manager loads each services/{name}/X.py
→ Calls driver interfaces to perform AWS describe/get calls
→ Returns raw JSON findings
→ Evaluator filters/scores findings
4) Findings passed to PageBuilder & frameworks:
→ Framework loads map.json to structure pages
→ Templates (Jinja-style) + AdminLTE assets used to assemble HTML
5) Reporter writes:
• per-account JSON (api-raw.json, api-full.json)
• HTML files + static assets
• Zips into output.zip
6) User downloads report from CloudShell
Separately, the scheduler use case:
• CDK deploys Lambdas (configUpdater, envInserter, resultProcesser)
• CloudWatch Event Rule triggers configUpdater on schedule
• configUpdater writes to DynamoDB
• DDB Stream / S3 events invoke resultProcesser → pushes findings to S3 / triggers CLI
Architectural patterns & design principles
• Modular service plugins: each AWS service scanner lives in its own folder + driver abstraction
• Strict separation: Core engine (CLI + orchestration), Service modules (data gather), Evaluator (logic), Presentation (frameworks + templates)
• Template-based static site generation (AdminLTE) for the UI
• Use of AWS CloudShell for host environment, boto3 SDK for service calls