SlideShare a Scribd company logo
#TechforPeople.
2
Innovative technology consulting for business. 3
Back to the Basics part 101
Infrastructure as Code
Meetup Cloud & DevOps @Devoteam
3rd of March 2020
Damien Carpy & David Frappart
4
About the speakers
● David Frappart
○ Career = “Cloud Black mage +7000 XP”
○ MainCharacteristic = “Talk too much, waaaaayyyy tooo fast!”
○ Description = $Career
○ AdditionalInfoTag = concat(“Azure MVP because”, $MainChararacteristic)
● Damien Carpy
○ Career = “15y XP in network / 7y in private Cloud / 1y in public Cloud”
○ AdditionalInfoTag = “IaC / Terraform / AWS enthusiast”
○ Favourite_quote = “Groumph, so old world”
agenda.
● Why did people need IaC?
● IaC keypoints
● Focus on Terraform
● Live demo
● Final thoughts
● Q & A
5
Why did people need IaC?
6
7
...OK, actually less than ten years ago (at best)...
...administrating infrastructure was hairy.
● There was almost no automation : admins had to repeat boring tasks over and over (like Sisyphus).
● Engineers may have written some obscure custom automation scripts…
○ ...But generally wouldn’t share them, or would finally leave the company with them, or
sometimes just simply lose them.
● Given which silo engineers worked in, devices (appliances and/or servers) would rarely expose API
to drive them, usually interactive interfaces, hence the difficulty of writing custom scripts.
nce upon a time…
8
Mission: impossible
● Staging new devices and reprogramming them was sometimes tricky due to huge scale
deployments and/or lack of skills and/or less than short timetable… sometimes it just seemed
overwhelming...
● Due to this heavy vertical siloing, engineers would eventually have to wait for others to end up
their task before beginning theirs.
● Ultimately, those granted with datacenter access would proceed directly in racks… with more or
less success (and cleanliness).
● Evolution & refresh was often a synonym of clean slate, “do it all over again”.
9
Major failure detected
● Managing high availability was such a huge challenge no one would really test full-scale
applicative automatic failover, because there was so much at stake, they would only schedule
manual failovers.
● And when huge incidents would eventually happen (remember Murphy’s law), infrastructure
would not behave as expected and fail, mostly because engineers from each silo wouldn’t talk to
each other, and also because in time, engineers would configure devices differently, without any
consistency..
10
And then Cloud happened.
● With cloud offerings - private as well as public - native API availability exploded for all
infrastructure layers.
● RESTful APIs are now a de facto standard, all sorts of functions can now be called from a variety of
speaking-API softwares, from a simple web browser to specialized tools.
● Specifically JSON language is now used for most APIs (over XML).
11
And then network got automated too.
● Even old gen appliances also began proposing an overlay API (with more or less success).
● Even lowest, stable layers like network and security began publishing APIs.
● They were the last layers to open themselves to automation, specifically with Software-Defined
Network and network virtualization turning points.
"Infrastructure as code (IaC)
= manage IT infrastructure using config files."
Wikipedia free interpretation
12
Now the whole IT infrastructure stack is open to full automation,
we can state some definition:
...but there’s still one challenge to beat: consistency
IaC keypoints
13
14
Benefit #1 : speed of execution, therefore cost-effectiveness
● Through heavy automation, IaC makes it feasible to handle huge provisioning, updates, or any
change involving tens or hundreds of devices in short time range, with a regular-sized team.
● Ultimately, IT infrastructure lifecycle may now be directly controlled by applications (Software-
Defined DataCenter) and integrate applications’ own lifecycle by becoming a component among
others within a CI/CD platform.
● Doing so, IaC enables IT infrastructure to join the DevOps movement.
● Much money is saved by reducing the duration of these lifecycles and increasing productivity.
● Engineers are freed from repetitive tasks, and can now focus on improving their code and
introducing added-values features.
15
Downside #1: Do more with less
● Costs reductions inevitably lead to teams’ size reduction.
● Not everyone embraces the turning point of code management (see Benefit #2): people who don’t
adapt will simply lose their jobs : it’s evolve (quickly) or die.
16
Benefit #2: Consistency (1/2)
● Using code implies inheriting multiple properties & possibilities:
○ Code is versionable through source control
(see our next meetup “Back to the Basics: GitOps”)
○ Git repository becomes the Single Source Of Truth for everyone using
versioned IaC scripts.
○ Changes should be traceable, only if authentication is correctly set up.
○ Authorize only IaC tools and code reduces errors induced by human
interactions that should be prohibited.
○ Any unwanted human modification should be logically be overwritten
by applying IaC script again (manually or periodically), in order to avoid
any discrepancies (configuration drift) and unwanted configuration
state.
17
Benefit #2: Consistency (2/2)
○ Applying well-crafted code, e.g. using modules, variables, etc. provides deterministic
results = fire & forget.
○ Tools should bring idempotence : applying the same script multiple times shouldn’t
build multiple times the same object or stupidly replace it.
18
Downside #2: Code this !
● Even if code versioning is most highly recommended and helps rolling back in case of
deployments errors, using IaC requires rigor & discipline.
● IaC scripts can wipe out an entire infrastructure at once and cause service outage and / or data
loss.
● Adopting an IaC tools implies a more or less complex learning curve, given the profile of the
engineer and the complexity of the tool’s language.
● Scripts can become complex to write & maintain because of the wide variety of infrastructure
services to drive : skills must evolve accordingly.
19
Methods, approaches, languages
● 2 methods for dispatching code: push (agentless) or pull (with agent).
● 2 approaches of code style: either imperative (how to compute things to achieve a goal) or
declarative (what to compute, i.e. the goal to reach), sometimes both.
● Tools use different scripting languages, either general-purpose (YAML, Ruby, PowerShell, etc.) or
domain-specific (HCL, etc.).
● Tools themselves are built using different programming languages such as C, Python, Go, etc.
20
Main tools & usual area of expertise
● Main competitors are Ansible, Chef, Puppet & Terraform.
○ Some of their features overlap, but they don’t follow the same objective.
○ For now, let’s just just accept the fact Terraform has no purpose being used as a system
configuration & management tool.
● All 3 major public cloud providers use their own tool, but they all suffer from being vendor-related:
○ AWS CloudFormation. JSON & YAML accepted.
○ Microsoft ARM Templates. JSON accepted.
○ Google Cloud Deployment Manager. Jinja (YAML-like) & Python accepted.
Focus on Terraform
21
● Created by HashiCorp in 2014, Terraform is an open source & free software written in Go.
● Hashicorp Configuration Language (HCL) used for scripting is API-agnostic and declarative.
(but Hashicorp kinda broke the rules with Terraform v0.12 using loops, that are imperative-style).
● Designed for driving multiple Cloud & infrastructure providers, using “providers” plugins.
○ Everyone can write their own provider plugin using Go.
● Stores the desired state configuration AND the actual state of ressources into a simple JSON-
formatted file (tfstate), A.K.A. the Precious… because it holds all your secrets.
○ There’s a lock function when working with state file on a remote location.
22
Terraform main features (1/2)
23
Terraform main features (2/2)
● Ensures idempotence : reduced risk of overprovisioning and credit card meltdown.
● Offers changes preview (plan) before applying: control THEN power.
● Changes are applied incrementally: implies fast changes.
● Handles destroying resources: useful for ephemeral environments.
● Resources are usually grouped in modules, that can also be custom-made for later use.
● Resources dependencies are automatically built using graph theory. Users don’t have to worry
about resources declaration ordering + API calls are parallelized: more faster changes.
24
Terraform pros...
● Free unless you wish to pay :-)
● Ensures all best features required for IaC.
● Lightweight & cross-platforms.
● Official site is OK but needs improvements.
○ e.g. missing outputs on some items, out-to-date examples, etc..
● Large supporting community
○ Mostly on Stack Overflow & such.
● Fast learning curve with HCL.
○ Investment is even more cost-efficient if you manage multiple providers.
25
Terraform cons...
● Terraform is still young but is evolving rapidly.
○ Some minor-numbered releases are in fact major releases (hello Terraform v0.12).
○ With v0.12 huge changes happened… But Hashicorp included an upgrade tool.
○ Cases were followed very seriously on their GitHub/issues section.
● Declarative approach would mean no loops (in fact: doable using “count”)
○ Since v0.12 you can use both : it may bring confusion (what about future upgrades ?).
● Not stupid-proof: “with great power, etc.”:
○ If you don’t know: stick to guidelines & best-practices,
○ If you think you know: try somewhere not sensitive first.
○ tfstate file holds your secrets (even your login & password if you’re not careful)
Live demo
26
27
Live demo on Microsoft Azure
28
Live demo: what do we do?
● Let’s try the classical n-tiers architecture.
● What do we need?
○ A RG
○ A VNet
○ Some Subnet and NSG because Micro-segmentation is cool
○ A public IP
○ A Load Balancer
○ Front End VM
○ Backend VM PaaS Database system if we have time
○ And that would be nice for one night
Final thoughts
29
30
Final thoughts
● IaC is made possible only if the whole IT stack offers API driving capabilities.
● Embracing IaC implies handling everything through code:
○ Code can be versioned in your favorite Single Source of Truth repository.
○ Deployments are fast, but so are errors that can wipe everything out.
○ Engineers must learn crafting code if they want to leverage IaC.
■ Therefore they must learn GitOps to work in teams and secure operations.
● Amongst other IaC tools, Terraform is (one of) the most complete and becomes the de facto
standard choice for public Cloud deployments.
Questions & answers
31
thank you.
#TechforPeople.
Damien Carpy
damien.carpy@devoteam.com
contact us.
33
David Frappart
david.frappart@devoteam.com

More Related Content

PDF
Season 7 Episode 1 - Tools for Data Scientists
PDF
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
PDF
Qt for beginners part 4 doing more
 
PDF
Flink Forward San Francisco 2018 keynote: Anand Iyer - "Apache Flink + Apach...
ODP
JDD2015: Towards the Fastest (J)VM on the Planet! - Jaroslav Tulach
PDF
OpenCL - The Open Standard for Heterogeneous Parallel Programming
PDF
Porting Motif Applications to Qt - Webinar
PPTX
z13: New Opportunities – if you dare!
Season 7 Episode 1 - Tools for Data Scientists
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
Qt for beginners part 4 doing more
 
Flink Forward San Francisco 2018 keynote: Anand Iyer - "Apache Flink + Apach...
JDD2015: Towards the Fastest (J)VM on the Planet! - Jaroslav Tulach
OpenCL - The Open Standard for Heterogeneous Parallel Programming
Porting Motif Applications to Qt - Webinar
z13: New Opportunities – if you dare!

What's hot (19)

PPTX
How to Build a Platform Team
PDF
Kubeflow Distributed Training and HPO
PPTX
Deep Dive Time Series Anomaly Detection in Azure with dotnet
PPTX
Anomaly Detection with Azure and .net
PDF
Update Strategies for the Edge, by Kat Cosgrove
PDF
Practical virtual network functions with Snabb (8th SDN Workshop)
PPTX
AWS Summit London 2019 - Containers on AWS
PDF
Advanced Model Inferencing leveraging Kubeflow Serving, KNative and Istio
PPTX
Kostas Tzoumas_Stephan Ewen - Keynote -The maturing data streaming ecosystem ...
PDF
Logstash Editor: The vscode extension to boost your productivity!
PDF
Operator development made easy with helm
PDF
Serverless architectures with Fn Project
PDF
Массовый параллелизм для гетерогенных вычислений на C++ для беспилотных автом...
PDF
Graal VM: Multi-Language Execution Platform
PDF
Graal and Truffle: Modularity and Separation of Concerns as Cornerstones for ...
PPTX
ONNX - The Lingua Franca of Deep Learning
PDF
How fpgas work when they don't
PDF
On the Capability and Achievable Performance of FPGAs for HPC Applications
PPTX
OpenShift Meetup - Red Hat OpenShift Container Storage explained
How to Build a Platform Team
Kubeflow Distributed Training and HPO
Deep Dive Time Series Anomaly Detection in Azure with dotnet
Anomaly Detection with Azure and .net
Update Strategies for the Edge, by Kat Cosgrove
Practical virtual network functions with Snabb (8th SDN Workshop)
AWS Summit London 2019 - Containers on AWS
Advanced Model Inferencing leveraging Kubeflow Serving, KNative and Istio
Kostas Tzoumas_Stephan Ewen - Keynote -The maturing data streaming ecosystem ...
Logstash Editor: The vscode extension to boost your productivity!
Operator development made easy with helm
Serverless architectures with Fn Project
Массовый параллелизм для гетерогенных вычислений на C++ для беспилотных автом...
Graal VM: Multi-Language Execution Platform
Graal and Truffle: Modularity and Separation of Concerns as Cornerstones for ...
ONNX - The Lingua Franca of Deep Learning
How fpgas work when they don't
On the Capability and Achievable Performance of FPGAs for HPC Applications
OpenShift Meetup - Red Hat OpenShift Container Storage explained
Ad

Similar to Meetup 2020 - Back to the Basics part 101 : IaC (20)

PDF
DevOps Fest 2020. immutable infrastructure as code. True story.
PDF
DevOps Days Boston 2017: Real-world Kubernetes for DevOps
PDF
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
PDF
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
PDF
[Srijan Wednesday Webinars] How to Build a Cloud Native Platform for Enterpri...
PDF
AirBNB's ML platform - BigHead
PDF
Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
PDF
Successful DevOps implementation for small teams a true story
PDF
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
PDF
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
PPTX
Kubernetes 101
PDF
Modern VoIP in Modern Infrastructures
PDF
The working architecture of NodeJS applications, Виктор Турский
PDF
The working architecture of node js applications open tech week javascript ...
PDF
introduction to micro services
PDF
Triangle Devops Meetup 10/2015
PDF
A case study why Zoominfo uses Terraform Cloud in high-scale environment.
PDF
TYPO3 CMS v8 in the cloud
PPTX
Kubernetes is hard! Lessons learned taking our apps to Kubernetes - Eldad Ass...
PDF
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
DevOps Fest 2020. immutable infrastructure as code. True story.
DevOps Days Boston 2017: Real-world Kubernetes for DevOps
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
[Srijan Wednesday Webinars] How to Build a Cloud Native Platform for Enterpri...
AirBNB's ML platform - BigHead
Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
Successful DevOps implementation for small teams a true story
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes 101
Modern VoIP in Modern Infrastructures
The working architecture of NodeJS applications, Виктор Турский
The working architecture of node js applications open tech week javascript ...
introduction to micro services
Triangle Devops Meetup 10/2015
A case study why Zoominfo uses Terraform Cloud in high-scale environment.
TYPO3 CMS v8 in the cloud
Kubernetes is hard! Lessons learned taking our apps to Kubernetes - Eldad Ass...
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
Ad

Recently uploaded (20)

PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPT
Teaching material agriculture food technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
A Presentation on Artificial Intelligence
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Empathic Computing: Creating Shared Understanding
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Modernizing your data center with Dell and AMD
PDF
Approach and Philosophy of On baking technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
“AI and Expert System Decision Support & Business Intelligence Systems”
The Rise and Fall of 3GPP – Time for a Sabbatical?
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Teaching material agriculture food technology
Advanced methodologies resolving dimensionality complications for autism neur...
A Presentation on Artificial Intelligence
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectral efficient network and resource selection model in 5G networks
Empathic Computing: Creating Shared Understanding
NewMind AI Weekly Chronicles - August'25 Week I
Modernizing your data center with Dell and AMD
Approach and Philosophy of On baking technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
CIFDAQ's Market Insight: SEC Turns Pro Crypto
MYSQL Presentation for SQL database connectivity
Machine learning based COVID-19 study performance prediction
NewMind AI Monthly Chronicles - July 2025
Understanding_Digital_Forensics_Presentation.pptx
Per capita expenditure prediction using model stacking based on satellite ima...

Meetup 2020 - Back to the Basics part 101 : IaC

  • 2. 2
  • 3. Innovative technology consulting for business. 3 Back to the Basics part 101 Infrastructure as Code Meetup Cloud & DevOps @Devoteam 3rd of March 2020 Damien Carpy & David Frappart
  • 4. 4 About the speakers ● David Frappart ○ Career = “Cloud Black mage +7000 XP” ○ MainCharacteristic = “Talk too much, waaaaayyyy tooo fast!” ○ Description = $Career ○ AdditionalInfoTag = concat(“Azure MVP because”, $MainChararacteristic) ● Damien Carpy ○ Career = “15y XP in network / 7y in private Cloud / 1y in public Cloud” ○ AdditionalInfoTag = “IaC / Terraform / AWS enthusiast” ○ Favourite_quote = “Groumph, so old world”
  • 5. agenda. ● Why did people need IaC? ● IaC keypoints ● Focus on Terraform ● Live demo ● Final thoughts ● Q & A 5
  • 6. Why did people need IaC? 6
  • 7. 7 ...OK, actually less than ten years ago (at best)... ...administrating infrastructure was hairy. ● There was almost no automation : admins had to repeat boring tasks over and over (like Sisyphus). ● Engineers may have written some obscure custom automation scripts… ○ ...But generally wouldn’t share them, or would finally leave the company with them, or sometimes just simply lose them. ● Given which silo engineers worked in, devices (appliances and/or servers) would rarely expose API to drive them, usually interactive interfaces, hence the difficulty of writing custom scripts. nce upon a time…
  • 8. 8 Mission: impossible ● Staging new devices and reprogramming them was sometimes tricky due to huge scale deployments and/or lack of skills and/or less than short timetable… sometimes it just seemed overwhelming... ● Due to this heavy vertical siloing, engineers would eventually have to wait for others to end up their task before beginning theirs. ● Ultimately, those granted with datacenter access would proceed directly in racks… with more or less success (and cleanliness). ● Evolution & refresh was often a synonym of clean slate, “do it all over again”.
  • 9. 9 Major failure detected ● Managing high availability was such a huge challenge no one would really test full-scale applicative automatic failover, because there was so much at stake, they would only schedule manual failovers. ● And when huge incidents would eventually happen (remember Murphy’s law), infrastructure would not behave as expected and fail, mostly because engineers from each silo wouldn’t talk to each other, and also because in time, engineers would configure devices differently, without any consistency..
  • 10. 10 And then Cloud happened. ● With cloud offerings - private as well as public - native API availability exploded for all infrastructure layers. ● RESTful APIs are now a de facto standard, all sorts of functions can now be called from a variety of speaking-API softwares, from a simple web browser to specialized tools. ● Specifically JSON language is now used for most APIs (over XML).
  • 11. 11 And then network got automated too. ● Even old gen appliances also began proposing an overlay API (with more or less success). ● Even lowest, stable layers like network and security began publishing APIs. ● They were the last layers to open themselves to automation, specifically with Software-Defined Network and network virtualization turning points.
  • 12. "Infrastructure as code (IaC) = manage IT infrastructure using config files." Wikipedia free interpretation 12 Now the whole IT infrastructure stack is open to full automation, we can state some definition: ...but there’s still one challenge to beat: consistency
  • 14. 14 Benefit #1 : speed of execution, therefore cost-effectiveness ● Through heavy automation, IaC makes it feasible to handle huge provisioning, updates, or any change involving tens or hundreds of devices in short time range, with a regular-sized team. ● Ultimately, IT infrastructure lifecycle may now be directly controlled by applications (Software- Defined DataCenter) and integrate applications’ own lifecycle by becoming a component among others within a CI/CD platform. ● Doing so, IaC enables IT infrastructure to join the DevOps movement. ● Much money is saved by reducing the duration of these lifecycles and increasing productivity. ● Engineers are freed from repetitive tasks, and can now focus on improving their code and introducing added-values features.
  • 15. 15 Downside #1: Do more with less ● Costs reductions inevitably lead to teams’ size reduction. ● Not everyone embraces the turning point of code management (see Benefit #2): people who don’t adapt will simply lose their jobs : it’s evolve (quickly) or die.
  • 16. 16 Benefit #2: Consistency (1/2) ● Using code implies inheriting multiple properties & possibilities: ○ Code is versionable through source control (see our next meetup “Back to the Basics: GitOps”) ○ Git repository becomes the Single Source Of Truth for everyone using versioned IaC scripts. ○ Changes should be traceable, only if authentication is correctly set up. ○ Authorize only IaC tools and code reduces errors induced by human interactions that should be prohibited. ○ Any unwanted human modification should be logically be overwritten by applying IaC script again (manually or periodically), in order to avoid any discrepancies (configuration drift) and unwanted configuration state.
  • 17. 17 Benefit #2: Consistency (2/2) ○ Applying well-crafted code, e.g. using modules, variables, etc. provides deterministic results = fire & forget. ○ Tools should bring idempotence : applying the same script multiple times shouldn’t build multiple times the same object or stupidly replace it.
  • 18. 18 Downside #2: Code this ! ● Even if code versioning is most highly recommended and helps rolling back in case of deployments errors, using IaC requires rigor & discipline. ● IaC scripts can wipe out an entire infrastructure at once and cause service outage and / or data loss. ● Adopting an IaC tools implies a more or less complex learning curve, given the profile of the engineer and the complexity of the tool’s language. ● Scripts can become complex to write & maintain because of the wide variety of infrastructure services to drive : skills must evolve accordingly.
  • 19. 19 Methods, approaches, languages ● 2 methods for dispatching code: push (agentless) or pull (with agent). ● 2 approaches of code style: either imperative (how to compute things to achieve a goal) or declarative (what to compute, i.e. the goal to reach), sometimes both. ● Tools use different scripting languages, either general-purpose (YAML, Ruby, PowerShell, etc.) or domain-specific (HCL, etc.). ● Tools themselves are built using different programming languages such as C, Python, Go, etc.
  • 20. 20 Main tools & usual area of expertise ● Main competitors are Ansible, Chef, Puppet & Terraform. ○ Some of their features overlap, but they don’t follow the same objective. ○ For now, let’s just just accept the fact Terraform has no purpose being used as a system configuration & management tool. ● All 3 major public cloud providers use their own tool, but they all suffer from being vendor-related: ○ AWS CloudFormation. JSON & YAML accepted. ○ Microsoft ARM Templates. JSON accepted. ○ Google Cloud Deployment Manager. Jinja (YAML-like) & Python accepted.
  • 22. ● Created by HashiCorp in 2014, Terraform is an open source & free software written in Go. ● Hashicorp Configuration Language (HCL) used for scripting is API-agnostic and declarative. (but Hashicorp kinda broke the rules with Terraform v0.12 using loops, that are imperative-style). ● Designed for driving multiple Cloud & infrastructure providers, using “providers” plugins. ○ Everyone can write their own provider plugin using Go. ● Stores the desired state configuration AND the actual state of ressources into a simple JSON- formatted file (tfstate), A.K.A. the Precious… because it holds all your secrets. ○ There’s a lock function when working with state file on a remote location. 22 Terraform main features (1/2)
  • 23. 23 Terraform main features (2/2) ● Ensures idempotence : reduced risk of overprovisioning and credit card meltdown. ● Offers changes preview (plan) before applying: control THEN power. ● Changes are applied incrementally: implies fast changes. ● Handles destroying resources: useful for ephemeral environments. ● Resources are usually grouped in modules, that can also be custom-made for later use. ● Resources dependencies are automatically built using graph theory. Users don’t have to worry about resources declaration ordering + API calls are parallelized: more faster changes.
  • 24. 24 Terraform pros... ● Free unless you wish to pay :-) ● Ensures all best features required for IaC. ● Lightweight & cross-platforms. ● Official site is OK but needs improvements. ○ e.g. missing outputs on some items, out-to-date examples, etc.. ● Large supporting community ○ Mostly on Stack Overflow & such. ● Fast learning curve with HCL. ○ Investment is even more cost-efficient if you manage multiple providers.
  • 25. 25 Terraform cons... ● Terraform is still young but is evolving rapidly. ○ Some minor-numbered releases are in fact major releases (hello Terraform v0.12). ○ With v0.12 huge changes happened… But Hashicorp included an upgrade tool. ○ Cases were followed very seriously on their GitHub/issues section. ● Declarative approach would mean no loops (in fact: doable using “count”) ○ Since v0.12 you can use both : it may bring confusion (what about future upgrades ?). ● Not stupid-proof: “with great power, etc.”: ○ If you don’t know: stick to guidelines & best-practices, ○ If you think you know: try somewhere not sensitive first. ○ tfstate file holds your secrets (even your login & password if you’re not careful)
  • 27. 27 Live demo on Microsoft Azure
  • 28. 28 Live demo: what do we do? ● Let’s try the classical n-tiers architecture. ● What do we need? ○ A RG ○ A VNet ○ Some Subnet and NSG because Micro-segmentation is cool ○ A public IP ○ A Load Balancer ○ Front End VM ○ Backend VM PaaS Database system if we have time ○ And that would be nice for one night
  • 30. 30 Final thoughts ● IaC is made possible only if the whole IT stack offers API driving capabilities. ● Embracing IaC implies handling everything through code: ○ Code can be versioned in your favorite Single Source of Truth repository. ○ Deployments are fast, but so are errors that can wipe everything out. ○ Engineers must learn crafting code if they want to leverage IaC. ■ Therefore they must learn GitOps to work in teams and secure operations. ● Amongst other IaC tools, Terraform is (one of) the most complete and becomes the de facto standard choice for public Cloud deployments.
  • 33. Damien Carpy damien.carpy@devoteam.com contact us. 33 David Frappart david.frappart@devoteam.com