Skip to content

Quick Reference & Decision Summary โ€‹

๐ŸŽฏ Key Decisions at a Glance โ€‹

QuestionDecisionDocument Reference
Language?C# (.NET 8+)04-LANGUAGE-PERFORMANCE.md
CDK or Terraform?AWS CDK00-PROJECT-HUB.md
Split or Unified?Unified with layers06-FRAMEWORK-ARCHITECTURE.md
Dynamic Config?DynamoDB + Lambda03-DYNAMIC-CONFIGURATION.md
Lambda Runtime?.NET 8 Native AOT04-LANGUAGE-PERFORMANCE.md
Design Patterns?GOF + System Patterns02-ARCHITECTURE-PATTERNS.md
Testing Framework?xUnit05-PROJECT-SETUP.md

๐Ÿ“ Architecture Layers โ€‹

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   High-Level API (Public)         โ”‚ โ† Users interact here
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚   Framework Core (Internal)       โ”‚ โ† Implementation details
โ”‚   โ€ข Configuration Manager          โ”‚
โ”‚   โ€ข Infrastructure Provisioner     โ”‚
โ”‚   โ€ข Flow Builder                   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚   AWS Layer (L1 + SDK)            โ”‚ โ† Direct AWS interaction
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ—๏ธ Design Patterns Used โ€‹

PatternPurposeWhere Used
BuilderFluent flow constructionFlowBuilder, QueueBuilder
FactoryCreate actions/componentsActionFactory, FlowFactory
StrategyRouting algorithmsRoutingStrategy
DecoratorAdd cross-cutting concernsLogging, Validation, Caching
CompositeFlow hierarchyFlowModule, ContactFlow
SingletonConfiguration managerConfigManager
ObserverConfig change notificationsConfigChangeNotifier
RepositoryData access abstractionConfigRepository
Unit of WorkTransaction coordinationConfigUnitOfWork
CQRSSeparate read/writeCommands vs Queries

๐Ÿ’พ DynamoDB Tables โ€‹

Table NamePartition KeySort KeyPurpose
ConnectFlowConfigurationsflowIdversionFlow runtime config
ConnectQueueConfigurationsqueueId-Queue settings
ConnectRoutingConfigurationsroutingKeyconditionIdRouting rules
ConnectLoggingConfigurationsresourceTyperesourceIdLogging config
ConnectFeatureFlagsfeatureNameenvironmentFeature toggles

โšก Performance Benchmarks โ€‹

ConfigurationCold StartWarm ExecutionCost (1M invocations)
Node.js 20287ms12ms$3.20
Python 3.12412ms18ms$3.20
C# Traditional1543ms24ms$4.50
C# Native AOT398ms21ms$3.20
C# + Provisioned0ms24ms$24.80

Recommendation: Use C# Native AOT for best balance of performance and cost.

๐Ÿ”„ Configuration Update Flow โ€‹

Admin Updates Config in DynamoDB
        โ†“
Cache Invalidation (Redis)
        โ†“
Next Call to Connect
        โ†“
Lambda Fetches Fresh Config
        โ†“
Flow Executes with New Config
        โ†“
โœ… Zero Downtime

๐Ÿ“ฆ Project Structure โ€‹

amazon-connect-cdk-framework/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ MyCompany.Connect.Framework/       # Main framework
โ”‚   โ”‚   โ”œโ”€โ”€ Core/                           # Orchestration
โ”‚   โ”‚   โ”œโ”€โ”€ Configuration/                  # DynamoDB config
โ”‚   โ”‚   โ”œโ”€โ”€ Infrastructure/                 # CDK constructs
โ”‚   โ”‚   โ”œโ”€โ”€ Flows/                          # Flow builder
โ”‚   โ”‚   โ””โ”€โ”€ Models/                         # Shared models
โ”‚   โ”œโ”€โ”€ MyCompany.Connect.Lambda.ConfigFetcher/
โ”‚   โ””โ”€โ”€ MyCompany.Connect.Deployment/       # CDK app
โ”œโ”€โ”€ test/
โ”‚   โ”œโ”€โ”€ MyCompany.Connect.Framework.Tests/
โ”‚   โ””โ”€โ”€ MyCompany.Connect.Lambda.Tests/
โ””โ”€โ”€ examples/

๐Ÿš€ Quick Start Commands โ€‹

bash
# Setup
dotnet new sln
dotnet new classlib -n Framework
dotnet new lambda.EmptyFunction -n ConfigFetcher
dotnet add package Amazon.CDK.Lib

# Build
dotnet build

# Test
dotnet test

# Deploy
cd src/Deployment
cdk synth
cdk deploy

# Lambda Native AOT
dotnet publish -c Release -r linux-x64 /p:PublishAot=true

๐Ÿงช Testing Strategy โ€‹

Test TypePurposeFramework
UnitIndividual componentsxUnit
IntegrationCDK + DynamoDBxUnit + Amazon.CDK.Assertions
SnapshotCloudFormation templatesCDK Assertions
E2EComplete workflowsLocalStack

Sample Unit Test โ€‹

csharp
[Fact]
public void TestQueueCreation()
{
    var app = new App();
    var stack = new Stack(app, "test");
    var template = Template.FromStack(stack);
    
    template.ResourceCountIs("AWS::Connect::Queue", 1);
    template.HasResourceProperties("AWS::Connect::Queue", 
        new Dictionary<string, object>
        {
            { "MaxContacts", 50 }
        });
}

๐Ÿ” Security Checklist โ€‹

  • [x] DynamoDB encryption at rest with KMS
  • [x] All API calls over HTTPS
  • [x] Lambda in VPC private subnets
  • [x] IAM least privilege roles
  • [x] Secrets in AWS Secrets Manager
  • [x] CloudTrail logging enabled
  • [x] Input validation on all configs
  • [x] No secrets in code or Git

๐Ÿ’ฐ Cost Estimates โ€‹

Monthly Infrastructure (medium call center):

  • DynamoDB: $10-20
  • Lambda: $5-15
  • S3: $1-5
  • ElastiCache (optional): $30-50
  • Total: ~$50-90/month

Excludes Amazon Connect per-minute usage charges

๐Ÿ“‹ Implementation Phases โ€‹

PhaseDurationFocus
1. FoundationWeeks 1-2Models, setup, structure
2. Flow BuilderWeeks 3-4Fluent interface, actions
3. CDK ConstructsWeeks 5-6L2 wrappers, dependencies
4. Config LayerWeeks 7-8DynamoDB, Lambda, cache
5. TestingWeeks 9-10Comprehensive tests
6. HardeningWeeks 11-12Security, docs, examples

๐ŸŽจ Code Style Conventions โ€‹

csharp
// Namespaces
namespace MyCompany.Connect.Framework.Core;

// Public classes - PascalCase
public class ContactFlowBuilder { }

// Methods - PascalCase
public void AddAction() { }

// Properties - PascalCase
public string FlowName { get; set; }

// Private fields - _camelCase
private readonly string _flowId;

// Constants - PascalCase
public const int MaxActions = 250;

// Fluent interface - return this
public ContactFlowBuilder SetName(string name)
{
    _name = name;
    return this;
}

๐Ÿ†˜ Common Issues & Solutions โ€‹

IssueSolution
CDK bootstrap failsCheck AWS credentials: aws sts get-caller-identity
Lambda cold starts too slowUse Native AOT or provisioned concurrency
DynamoDB throttlingIncrease provisioned capacity or use on-demand
Flow validation errorsCheck action count (<250) and JSON structure
CDK synth timeoutBreak into smaller stacks
Test failuresRun dotnet restore --force

๐ŸŽ“ Learning Resources โ€‹

Start Here โ€‹

  1. Read 00-PROJECT-HUB.md - Overview
  2. Follow 05-PROJECT-SETUP.md - Setup
  3. Study 02-ARCHITECTURE-PATTERNS.md - Patterns

Deep Dives โ€‹

๐Ÿ“ž Getting Help โ€‹

  1. Check this quick reference
  2. Search specific document
  3. Review code examples
  4. Check troubleshooting guide
  5. Ask team/community

โœ… Pre-Deployment Checklist โ€‹

  • [ ] All tests passing
  • [ ] CDK synth succeeds
  • [ ] Security review completed
  • [ ] Cost estimates reviewed
  • [ ] Documentation updated
  • [ ] Examples working
  • [ ] CI/CD pipeline tested
  • [ ] Monitoring configured
  • [ ] Rollback plan documented

๐Ÿ”„ Update Workflow โ€‹

bash
# Make code changes
# โ†“
# Run tests
dotnet test
# โ†“
# Check CDK diff
cdk diff
# โ†“
# Deploy to dev
cdk deploy --profile dev
# โ†“
# Verify in dev environment
# โ†“
# Deploy to prod
cdk deploy --profile prod
# โ†“
# Monitor metrics

๐ŸŽฏ Success Metrics โ€‹

MetricTargetTracking
Test Coverage>80%dotnet test --collect:"XPlat Code Coverage"
Cold Start<500msCloudWatch Logs
Config Fetch<50msCloudWatch Metrics
Deployment Time<5minCI/CD pipeline
Documentation100% public APIsXML comments

๐Ÿ’ก Pro Tips โ€‹

  1. Start Simple: Use high-level API first
  2. Test Early: Write tests as you build
  3. Cache Aggressively: Reduce DynamoDB reads
  4. Monitor Always: CloudWatch dashboards
  5. Version Everything: Git + semantic versioning
  6. Document Decisions: ADRs in Notion
  7. Review Regularly: Weekly progress checks
  8. Refactor Ruthlessly: Keep code clean
  9. Optimize Later: Make it work, then fast
  10. Share Knowledge: Team demos and docs

Print this page for quick reference during development!

Preview release - Licensing terms TBD before 1.0