Integrating Infrastructure
as Code into a Continuous
Delivery Pipeline
Considerations & Best
Practices
Adarsh Shah
Technology Leader, Coach, Hands-on Architect
Independent Consultant
@shahadarsh
shahadarsh.com
Slide 2
Slide 2 text
@shahadarsh shahadarsh.com
We are going to cover..
• Infrastructure as Code
• Continuous Delivery
• Considerations & best practices when integrating IaC to CD
• Source Control
• Testing
• Security
• Compliance
• Patterns for Provisioning
• Build and Deploy pipelines
• GitOps
• People & Process
Slide 3
Slide 3 text
@shahadarsh shahadarsh.com
Infrastructure as Code
Infrastructure as Code (IaC) is the approach that takes
proven coding techniques used by software systems
and extends them to infrastructure.
Slide 4
Slide 4 text
@shahadarsh shahadarsh.com
Challenges without IaC
• Configuration Drift
• Snowflake Servers
• Human Error
• Time to Complete
Slide 5
Slide 5 text
@shahadarsh shahadarsh.com
Continuous Delivery
Continuous Delivery is the ability to get changes of all
types—including new features, configuration changes, bug
fixes and experiments—into production, or into the hands
of users, safely and quickly in a sustainable way.
- Jez Humble
Slide 6
Slide 6 text
@shahadarsh shahadarsh.com
Continuous Delivery
Slide 7
Slide 7 text
shahadarsh.com
@shahadarsh
Considerations & Best
Practices
Slide 8
Slide 8 text
@shahadarsh shahadarsh.com
Source Control
Slide 9
Slide 9 text
@shahadarsh shahadarsh.com
Source Control
• Everything in source control
• Code accessibility
• Modularize
• Version the Modules
• Collaboration!!
• Code/test as documentation
Slide 10
Slide 10 text
@shahadarsh shahadarsh.com
Infra as Code testing
Static Analysis
terraform validate, TFLint, puppet parser validate
Unit
bats, chefspec
Smoke
w/ dummy app
Selenium
Integration
inspec, goss
Brittle
Cost
Maintenance
Infra as Code Test Pyramid
Duration
@shahadarsh shahadarsh.com
Compliance
• Finance, Healthcare & other industries
• SOX, PII, HIPPA, PCI, GDPR
• Compliance as Code - Code instead of Paperwork
• Chef InSpec, HashiCorp Sentinel (Policy as Code)
Slide 14
Slide 14 text
@shahadarsh shahadarsh.com
Compliance as Code using HashiCorp Sentinel
Ensure that modification of critical data can only be performed
by authorized sysops with valid MFA
Slide 15
Slide 15 text
@shahadarsh shahadarsh.com
Patterns for Provisioning
• Immutable VMs
• Containerized Services
• Base Image & App Pull
Slide 16
Slide 16 text
@shahadarsh shahadarsh.com
Immutable VMs
• Infra Module - Multitier App
• Loosely Coupled
• App Image consumed by Infrastructure Module
@shahadarsh shahadarsh.com
Containerized Services
• Infra Module - Container Management System
• Fully Decoupled from Apps
• Apps are deployed with Container Management System
specific tools
@shahadarsh shahadarsh.com
People & Process
• Enables teams to interact
• Infra, Security, Compliance, QA etc teams work together
• Improvement in processes
• Faster feedback
Slide 25
Slide 25 text
@shahadarsh shahadarsh.com
Infra
Compliance
Security
Production
Inspection
Slide 26
Slide 26 text
@shahadarsh shahadarsh.com
Building Quality In
Infra Compliance
Security
Production
Slide 27
Slide 27 text
@shahadarsh shahadarsh.com
Summary
• Infrastructure as Code
• Continuous Delivery
• Considerations & best practices when integrating IaC to CD
• Source Control
• Testing
• Security
• Compliance
• Patterns for Provisioning
• Build and Deploy pipelines
• GitOps
• People & Process
Slide 28
Slide 28 text
Questions on
Slack #2019addo-ci-cd
Adarsh Shah
Technology Leader, Coach, Hands-on Architect
Independent Consultant
@shahadarsh
shahadarsh.com