How aws-samples/sample-network-resilience-agent works
Network Resilience Agent discovers AWS Direct Connect and related network resources, assesses resilience, and presents an interactive topology with recommendations. The main workflow runs from AWS connection and topology retrieval through graph construction and assessment to the visualizer. Separate capabilities provide Bedrock-based topology-aware chat, on-demand operational views, and snapshot/report export. The README documents additional discovery, resilience, and sharing capabilities beyond the sampled excerpts; links for those are included only where the tree or documentation supports them.
Main entry points: useTopology.ts Topology workflow · topology-store.ts Topology state · App.tsx Application shell · chat-service.ts Chat service
Components 25
Access and discovery
- AWS connection
dx-visualizer/src/components/TopBar.tsx - SSO login
dx-visualizer/src/components/SsoLoginFlow.tsx - SSO service
backend/src/app.ts - SSO operations
backend/src/sso-service.ts - Topology discovery
dx-visualizer/src/api/fetch-topology.ts - Account enrichment
dx-visualizer/src/api/ec2.ts
Topology analysis
- Topology workflow
dx-visualizer/src/hooks/useTopology.ts - Topology state
dx-visualizer/src/store/topology-store.ts - Graph construction
dx-visualizer/src/engine/topology-builder.ts - Graph layout
dx-visualizer/src/engine/layout-engine.ts - Resilience assessment
dx-visualizer/src/engine/recommendation-engine.ts
Visualization
- Application shell
dx-visualizer/src/App.tsx - Interactive diagram
dx-visualizer/src/components/FlowCanvas.tsx - Resilience status
dx-visualizer/src/components/ResiliencyScoreCard.tsx
AI assistant
- Chat panel
dx-visualizer/src/components/ChatPanel.tsx - Chat service
dx-visualizer/src/chat/chat-service.ts - Bedrock streaming
dx-visualizer/src/chat/bedrock-client.ts - Chat tools
dx-visualizer/src/chat/tool-executor.ts
Operations and sharing
- Live route overlay
dx-visualizer/src/api/dx-routes.ts - Report export
dx-visualizer/src/hooks/useExportReport.ts - Snapshot import
dx-visualizer/src/hooks/useImportSnapshot.ts - Image export
dx-visualizer/src/hooks/useExportImage.ts
Other components
- Network engineer
- AWS APIs
- Amazon Bedrock
Connections 35
- Network engineer → Application shell: uses
- Application shell → AWS connection: offers connection
- Network engineer → SSO login: authenticates
- SSO login → SSO service: requests SSO
- SSO service → SSO operations: invokes
- SSO operations → AWS APIs: calls identity APIs
- AWS connection → Topology workflow: provides credentials
- Topology workflow → Topology discovery: requests discovery
- Topology discovery → AWS APIs: queries network APIs
- Topology workflow → Account enrichment: enriches VPCs
- Account enrichment → AWS APIs: assumes role and reads
- Topology workflow → Topology state: updates state
- Topology workflow → Graph construction: builds graph
- Topology workflow → Resilience assessment: assesses topology
- Topology workflow → Graph layout: positions nodes
- Topology workflow → Topology state: stores graph
- Application shell → Interactive diagram: renders
- Application shell → Resilience status: renders
- Interactive diagram → Topology state: reads topology
- Resilience status → Topology state: reads assessment
- Application shell → Chat panel: renders
- Chat panel → Chat service: sends messages
- Chat service → Topology state: reads topology context
- Chat service → Bedrock streaming: streams conversation
- Bedrock streaming → Amazon Bedrock: converses
- Bedrock streaming → Chat tools: dispatches tools
- Chat tools → AWS APIs: queries live data
- Network engineer → Live route overlay: requests routes
- Live route overlay → AWS APIs: fetches BGP routes
- Network engineer → Report export: exports report
- Report export → Topology state: reads topology and findings
- Network engineer → Snapshot import: imports snapshot
- Snapshot import → Topology state: loads topology
- Network engineer → Image export: exports image
- Image export → Interactive diagram: captures diagram