Slide 1

Slide 1 text

From Infrastructure as Code to Environment as Code Challenges scaling IaC and how to resolve them Adarsh Sha h Engineering Leader, Coach, Public Speake r Founder & CEO at CompuZes t @shahadarsh 
 https://compuzest.com https://bit.ly/iac-to-eac

Slide 2

Slide 2 text

https://compuzest.com @shahadarsh Infrastructure as Code Infrastructure as Code (IaC) is an approach that takes proven coding techniques used by software systems and extends it to infrastructure. It is one of the key DevOps practices that enable teams to deliver infrastructure, and thereby software running on it, rapidly and reliably, at scale.

Slide 3

Slide 3 text

https://compuzest.com @shahadarsh IaC: Principles, Patterns, and Practices • Key Principles • Idempotenc y • Immutabilit y • Patterns and Practice s • Source Contro l • Modularize and Versio n • Documentatio n • Testin g • Security and Complianc e • Automate Execution from a Shared Environmen t • IaC Pipelin e • GitOps Article/Talk: https://bit.ly/iac-to-eac

Slide 4

Slide 4 text

https://compuzest.com @shahadarsh Idempotency Idempotency means no matter how many times you run your IaC and, what your starting state is, you will end up with the same end state. This simpli fi es the provisioning of Infrastructure and reduces the chances of inconsistent results.

Slide 5

Slide 5 text

https://compuzest.com @shahadarsh Non-Idempotent Provision VM VM VM { } IaC 3 VMs End State
 Expected = 3 Actual = 6 Idempotent End State
 Expected = 3 Actual = 3 Reapply VM VM VM Provision VM VM VM Reapply No change { } IaC 3 VMs

Slide 6

Slide 6 text

https://compuzest.com @shahadarsh Immutability Immutable infrastructure means instead of changing an existing infrastructure you replace it with new. By provisioning new infrastructure every time, you are making sure it is reproducible and doesn’t allow for con fi guration drift over time.

Slide 7

Slide 7 text

https://compuzest.com @shahadarsh Provision v1 v1 v1 User Mutable Infrastructure { } IaC Apply changes v2 v2 v2 Change { } IaC v1 v1 v1 Provision User Provision v2 v2 v2 User Immutable Infrastructure { } IaC Change { } IaC Deploys v2 to same Infrastructure Provisions new Infrastructure with v2

Slide 8

Slide 8 text

https://compuzest.com @shahadarsh Automate Execution from a Shared Environment

Slide 9

Slide 9 text

https://compuzest.com @shahadarsh VM VM VM Static Analysis Unit Tests Continuous Integration Compliance Integration Tests Security VM VM VM Testing & Validation Ephemeral Environment Provision Smoke Tests Smoke Tests Note: This example is for Platform Layer but similar pipeline should be added for other layers (account, network & application) IaC Pipeline

Slide 10

Slide 10 text

https://compuzest.com @shahadarsh GitOps GitOps = IaC + (Work fl ow + Control Loop)

Slide 11

Slide 11 text

https://compuzest.com @shahadarsh Create Pull Request , Plan & Tests Terraform Apply VM VM VM Terraform Plan & Tests Approve & 
 Merge PR Control Loop Verify Desired & Actual State Sync (if different) Provision GitOps

Slide 12

Slide 12 text

https://compuzest.com @shahadarsh

Slide 13

Slide 13 text

https://compuzest.com @shahadarsh

Slide 14

Slide 14 text

https://compuzest.com @shahadarsh Challenges scaling IaC • Hand-rolling Pipelines • Teams want an Entire Environment and not just individual resources • Replicating Environments • Visualizing and Understanding Environments • Infrastructure Drift Article/Talk: https://bit.ly/iac-to-eac

Slide 15

Slide 15 text

https://compuzest.com @shahadarsh Environment as Code Environment as Code (EaC) is an abstraction over Infrastructure as Code that provides a way of de fi ning an entire Infrastructure Environment. It manages state for the environment including dependences between various resources in the Environment and supports best practices like Loose coupling, Idempotency, Immutability etc. for an Environment. It allows teams to deliver entire environments (instead of individual infrastructure resources) rapidly and reliably, at scale.

Slide 16

Slide 16 text

https://compuzest.com @shahadarsh Environment as Code Example

Slide 17

Slide 17 text

https://compuzest.com @shahadarsh EaC features • De fi ne Entire Environment • Various Infrastructure Resource s • Dependencies between resource s • Manage State for the entire Environmen t • Idempotent and Immutable for entire Environmen t • Loose Couplin g • Visualize and Understand Environment s • Infrastructure Drift

Slide 18

Slide 18 text

Adarsh Sha h Engineering Leader, Coach, Public Speake r Founder & CEO at CompuZes t @shahadarsh 
 https://compuzest.com https://bit.ly/iac-to-eac