#!/usr/bin/env nu # Demo 3: Hybrid Infrastructure Management # Shows on-premises + cloud integration # Target audience: Enterprise IT, system architects print "=== Demo 3: Hybrid Infrastructure Management ===" print "\n1. Setting up hybrid infrastructure (on-prem + cloud)..." # Create hybrid infrastructure spanning multiple providers print "Creating hybrid setup: on-premises + AWS + edge..." run-external "provisioning" generate infra --new "hybrid-demo" --providers "local,aws,edge" --topology hybrid print "\n2. Infrastructure topology:" run-external "provisioning" show topology --infra "hybrid-demo" --visual # Simulated topology visualization print "\nšŸ¢ Hybrid Infrastructure Topology:" print "ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”" print "│ On-Premise │◄──►│ AWS │◄──►│ Edge/IoT │" print "│ │ │ │ │ │" print "│ • Database │ │ • Web Apps │ │ • Sensors │" print "│ • Storage │ │ • API │ │ • Gateways │" print "│ • Backup │ │ • CDN │ │ • Analytics │" print "ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜" print "\n3. Deploying components to optimal locations..." # Deploy database to on-premises for compliance run-external "provisioning" taskserv create postgresql --infra "hybrid-demo" --provider local --compliance "data-sovereignty" # Deploy web application to AWS for scalability run-external "provisioning" taskserv create web-app --infra "hybrid-demo" --provider aws --auto-scale # Deploy IoT gateway to edge for low latency run-external "provisioning" taskserv create iot-gateway --infra "hybrid-demo" --provider edge --latency-optimized print "\n4. Network configuration with VPN mesh:" run-external "provisioning" network create --infra "hybrid-demo" --type mesh --encryption wireguard print "\n5. Data flow and compliance:" let data_flows = [ {source: "IoT Sensors", destination: "Edge Gateway", latency: "5ms", compliance: "āœ…"}, {source: "Edge Gateway", destination: "On-Prem DB", latency: "50ms", compliance: "āœ… GDPR"}, {source: "On-Prem DB", destination: "AWS API", latency: "100ms", compliance: "āœ… Encrypted"}, {source: "AWS API", destination: "CDN", latency: "10ms", compliance: "āœ…"} ] $data_flows | table print "\n6. Cost optimization across providers:" let cost_breakdown = [ {component: "Database", location: "On-Premise", cost: "$500/month", reason: "Compliance + Control"}, {component: "Web Apps", location: "AWS", cost: "$800/month", reason: "Auto-scaling"}, {component: "IoT Gateway", location: "Edge", cost: "$200/month", reason: "Low latency"}, {component: "Network", location: "Hybrid", cost: "$300/month", reason: "VPN mesh"} ] $cost_breakdown | table print "\n7. Monitoring and observability across all environments:" run-external "provisioning" monitoring setup --infra "hybrid-demo" --unified-dashboard print "\n8. Disaster recovery strategy:" run-external "provisioning" backup create --infra "hybrid-demo" --strategy "3-2-1" --cross-provider print "\nāœ… Result: Seamless hybrid operations with unified management" print "šŸ’° Cost: 40% savings vs pure cloud (compliance + optimization)" print "šŸ›”ļø Security: End-to-end encryption, zero-trust networking" print "šŸ“Š Visibility: Single pane of glass for all environments"