NickSoftware.Switchboard
0.1.0-preview.16
dotnet add package NickSoftware.Switchboard --version 0.1.0-preview.16
NuGet\Install-Package NickSoftware.Switchboard -Version 0.1.0-preview.16
<PackageReference Include="NickSoftware.Switchboard" Version="0.1.0-preview.16" />
<PackageVersion Include="NickSoftware.Switchboard" Version="0.1.0-preview.16" />
<PackageReference Include="NickSoftware.Switchboard" />
paket add NickSoftware.Switchboard --version 0.1.0-preview.16
#r "nuget: NickSoftware.Switchboard, 0.1.0-preview.16"
#:package NickSoftware.Switchboard@0.1.0-preview.16
#addin nuget:?package=NickSoftware.Switchboard&version=0.1.0-preview.16&prerelease
#tool nuget:?package=NickSoftware.Switchboard&version=0.1.0-preview.16&prerelease
Switchboard - Amazon Connect Infrastructure Framework
A code-first, type-safe .NET framework for building Amazon Connect contact centers using AWS CDK.
Overview
Switchboard provides a modern, fluent API for defining Amazon Connect resources as code. Built on .NET 10 and AWS CDK, it eliminates the need for manual console configuration and enables version-controlled, testable contact center infrastructure.
Features
- Fluent Builder API: Intuitive, chainable methods for building contact flows, queues, and routing profiles
- Type-Safe: Full IntelliSense support with strong typing throughout
- CDK Integration: Seamless integration with AWS CDK for infrastructure as code
- Modular Design: Clean separation of concerns following SOLID principles
- Testable: Comprehensive unit tests with NUnit and FluentAssertions
- .NET 10: Built on the latest .NET platform with modern C# features
Quick Start
Prerequisites
- .NET 10 SDK
- AWS CLI configured with credentials
- AWS CDK CLI (
npm install -g aws-cdk)
Installation
dotnet add package Switchboard
Basic Example
using Switchboard;
var app = new SwitchboardApp();
var stack = app.CreateStack("MyCallCenter", "MyConnectInstance");
// Create hours of operation
var hours = new HoursOfOperation
{
Name = "BusinessHours",
TimeZone = "America/New_York"
};
for (var day = DayOfWeek.Monday; day <= DayOfWeek.Friday; day++)
{
hours.AddDayConfig(new HoursOfOperationConfig
{
Day = day,
StartTime = new TimeRange { Hours = 9, Minutes = 0 },
EndTime = new TimeRange { Hours = 17, Minutes = 0 }
});
}
stack.AddHoursOfOperation(hours);
// Create a queue
var queue = new QueueBuilder()
.SetName("Sales")
.SetDescription("Sales inquiries queue")
.SetMaxContacts(50)
.Build();
stack.AddQueue(queue, "BusinessHours");
// Create a contact flow
var flow = new FlowBuilder()
.SetName("MainFlow")
.PlayPrompt("Thank you for calling. Please wait while we connect you.")
.TransferToQueue("Sales")
.Build();
stack.AddContactFlow(flow);
// Synthesize to CloudFormation
app.Synth();
Deploy
cd examples/SimpleCallCenter
cdk deploy
Architecture
Core Components
- Models: Strongly-typed domain models for Amazon Connect resources
ContactFlow,Queue,RoutingProfile,HoursOfOperation,User
- Builders: Fluent builders for creating resources
FlowBuilder,QueueBuilder,RoutingProfileBuilder
- CDK Constructs: AWS CDK constructs for deployment
ContactFlowConstruct,QueueConstruct,RoutingProfileConstruct
- Framework: Core orchestration classes
SwitchboardApp,SwitchboardStack
Project Structure
src/
├── Switchboard/ # Core framework library
│ ├── Models/ # Domain models
│ ├── Builders/ # Fluent builders
│ ├── Constructs/ # CDK constructs
│ └── Core/ # Framework orchestration
tests/
├── Switchboard.Tests/ # Unit tests
examples/
├── SimpleCallCenter/ # Basic example
Building Contact Flows
Using the Fluent Builder
var flow = new FlowBuilder()
.SetName("CustomerService")
.SetDescription("Customer service flow")
.PlayPrompt("Welcome to customer service")
.GetCustomerInput("Press 1 for sales, 2 for support", input =>
{
input.MaxDigits = 1;
input.TimeoutSeconds = 5;
})
.TransferToQueue("Support")
.Disconnect()
.Build();
Supported Actions
PlayPrompt()- Play a message to the callerTransferToQueue()- Transfer to a queueGetCustomerInput()- Collect DTMF inputInvokeLambda()- Call AWS Lambda functionCheckHoursOfOperation()- Check business hoursDisconnect()- End the contact
Creating Queues
var queue = new QueueBuilder()
.SetName("PremiumSupport")
.SetDescription("Premium customer support")
.SetMaxContacts(25)
.SetHoursOfOperation("24x7")
.SetOutboundCallerId("Support Team", "+18005551234")
.AddTag("Department", "Support")
.AddTag("Priority", "High")
.Build();
stack.AddQueue(queue, "24x7");
Routing Profiles
var profile = new RoutingProfileBuilder()
.SetName("AgentProfile")
.SetDescription("Standard agent routing profile")
.AddMediaConcurrency(ChannelType.Voice, concurrency: 1)
.AddMediaConcurrency(ChannelType.Chat, concurrency: 3)
.AddQueue(queueArn, ChannelType.Voice, priority: 1, delay: 0)
.Build();
stack.AddRoutingProfile(profile);
Hours of Operation
var hours = new HoursOfOperation
{
Name = "24x7",
TimeZone = "UTC"
};
for (var day = DayOfWeek.Sunday; day <= DayOfWeek.Saturday; day++)
{
hours.AddDayConfig(new HoursOfOperationConfig
{
Day = day,
StartTime = new TimeRange { Hours = 0, Minutes = 0 },
EndTime = new TimeRange { Hours = 23, Minutes = 59 }
});
}
stack.AddHoursOfOperation(hours);
Testing
The framework includes comprehensive unit tests:
dotnet test
Example test:
[Test]
public void Build_WithValidConfiguration_ShouldCreateFlow()
{
// Arrange
var builder = new FlowBuilder();
// Act
var flow = builder
.SetName("TestFlow")
.PlayPrompt("Welcome")
.TransferToQueue("Sales")
.Build();
// Assert
flow.Should().NotBeNull();
flow.Name.Should().Be("TestFlow");
flow.Actions.Should().HaveCount(2);
}
CDK Integration
Switchboard generates standard AWS CDK constructs that can be customized:
var stack = app.CreateStack("MyStack", "MyInstance", "123456789012", "us-east-1");
// Add resources
stack.AddHoursOfOperation(hours);
stack.AddQueue(queue);
stack.AddContactFlow(flow);
// Access underlying CDK constructs if needed
var queueConstruct = stack.GetQueue("Sales");
var queueArn = queueConstruct?.QueueArn;
// Synthesize
app.Synth();
Roadmap
Phase 1 (Current)
- ✅ Core domain models
- ✅ Fluent builders
- ✅ Basic CDK constructs
- ✅ Unit tests
Phase 2 (Planned)
- Attribute-based flow definitions
- Advanced flow actions (Set attributes, Check conditions)
- Flow modules and reusable components
- DynamoDB-backed dynamic configuration
Phase 3 (Future)
- Source generators for compile-time validation
- Roslyn analyzers for design-time feedback
- Visual Studio/VS Code extensions
- Flow visualization tools
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
This project is licensed under the MIT License - see LICENSE for details.
Resources
Support
- GitHub Issues: Report bugs or request features
- Documentation: Full documentation
- Examples: Example projects
Built with ❤️ using .NET 10 and AWS CDK
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Amazon.CDK.Lib (>= 2.171.1)
- AWSSDK.Connect (>= 4.0.14.1)
- Constructs (>= 10.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.16 | 70 | 10/26/2025 |