Infrastructure as Code (IaC)
Practice of managing and provisioning cloud infrastructure through code artifacts instead of manual processes. Ensures version control
Automated Infrastructure Provisioning
IaC activates automated provisioning of contact center resources. Includes servers
Configuration Management Benefit
Configuration Management Benefit (IaC) → Deploy IVR
This is about using tools like CloudFormation, CDK, or Terraform to deploy your entire IVR/contact flow infrastructure as code.
Scalability and Elasticity Benefit
Define infrastructure scaling rules in code to automatically adjust resources based on demand. Improves performance and cost efficiency during peak call times.
High Availability and Disaster Recovery
IaC facilitates HA and DR strategies by coding redundant servers
High Availability and Disaster Recovery → IaC facilitates HA and DR by coding redundant servers
This is about using IaC to quickly spin up identical infrastructure in another region if your primary goes down.
DevOps Integration Benefit
IaC aligns with DevOps by promoting collaboration between dev and ops teams. Manage changes through version control
Cost Optimization Benefit
IaC helps optimize costs by dynamically provisioning and deprovisioning resources based on workload requirements. Avoids overprovisioning and minimizes idle resources.
AWS CloudFormation
IaC tool that uses JSON or YAML templates to specify AWS resources. Developers create stacks from templates and delete stacks to remove resources when no longer needed.
CloudFormation Advantages
Accessible JSON/YAML formats
CloudFormation Limitations
CloudFormation uses YAML/JSON templates—you describe what you want, not how to build it. No real programming logic.
Key points for interviews:
∙ Can’t use loops, conditionals, or variables like real code
∙ Limited to intrinsic functions (!Ref, !If, !Sub, etc.)
∙ Complex logic gets messy fast in YAML
∙ No native support for things like iteration over lists
The workaround → AWS CDK:
∙ Write infrastructure in Python, TypeScript, Java, C#, Go
∙ Use actual programming constructs (loops, conditionals, classes)
∙ CDK synthesizes into CloudFormation templates under the hood
∙ Best of both worlds: real code + CloudFormation’s deployment engine
AWS CDK
Open-source framework for defining cloud infrastructure as code in common programming languages like Python
AWS CDK Advantages
Programming language support
AWS CDK Limitations
Dependency on CloudFormation quotas and limits. Code sharing requires packages or libraries for each programming language instead of simple template reuse.
CloudFormation Use Cases
CloudFormation is ideal for straightforward, repeatable Connect deployments—not complex logic.
AWS CDK Use Cases
Complex deployments with interdependent components
CloudFormation Reusability
Use same template to create development
CloudFormation Custom Resources
Support for custom resources to extend resource deployment and update capabilities beyond standard AWS resources.
CloudFormation Error Handling
CloudFormation Error Handling → Automatically rolls back resources when errors occur. Provides fast [recovery]
This is a key safety feature—if any resource in your stack fails to create/update, CloudFormation undoes everything to keep you in a known good state.
AWS CDK Abstraction
Use object-oriented programming to define methods or classes to modularize code. Provides classes for multiple AWS resource types with built-in defaults.
AWS CDK Abstraction → Use OOP to define methods/classes, provides classes for AWS resources with built-in defaults
CDK lets you write real code with reusable components instead of copy-pasting YAML.
AWS CDK S3 Bucket Deletion
Set Boolean property to true on S3 bucket resources to remove bucket with full content. CloudFormation alone cannot delete non-empty buckets without error.
AWS CDK Multi-Stack Deployment
Create multiple stacks in AWS CDK app and pass values between stacks using input parameters and instance attributes. Handles complex deployments.
When to use CloudFormation for standardization
Deploy standardized infrastructure with multiple identical instances for different business units. Provides declarative template management
When to use AWS CDK for serverless
When to use AWS CDK for serverless → Implement serverless architecture with Lambda
CDK excels when you’re wiring up Lambda with other AWS services—the complexity would be painful in raw CloudFormation.
CloudFormation Declarative Approach
Precise control over resource configurations ideal for managing complex infrastructures. Specify exactly what resources to create without programming logic.