Post HashiConf EU Meetup 07/11/2019
Amsterdam
Julien Corioland
• Senior Software Engineer @ Microsoft
• Paris, France
• https://blog.jcorioland.io
• https://github.com/jcorioland
• https://twitter.com/jcorioland
Infrastructure as Code
Think about immutable and disposable infrastructure.
Pet vs Cattle
Pet Model
• You care so much about
your infrastructure that you
give it lovely names
• Earth, Jupiter, Mars …
• Goals: each server part of
your infrastructure should
be up 24/7
Cattle Model
• You stop naming your
servers and consider it as
“disposable” infrastructure
• front-01, front-02, front-
03…
• Goals: n servers are part of
the infrastructure 24/7
Cloud platforms make it possible
All is about automation
Imperative (Bash/PS scripts)
Declarative (ARM, Terraform…)
Idempotency
Infrastructure = code
• Stored in the source code repository
(GitHub, Azure Repos…), it’s just text!
• Same lifecycle
• You update the code, you update the
infrastructure
• Continuous Integration / Continuous
Deployment
• Versioning
• Labels / Rollbacks
• Also valid for configuration (configuration as
code)
Terraform
Write, Plan, and Create Infrastructure as Code
What is Terraform?
• An open source tool/language (HCL) developed by HashiCorp
• Allows to write, plan and create infrastructure as code
• Common language for different providers
• Azure
• AWS
• Google
• Kubernetes
• …
• Same workflow / pipeline
• But different resources!
Data Sources
& Resources
Terraform
Workflow
Init
Plan
Apply
Destroy
Demonstration
Hello Terraform on Azure!
Advanced Workloads
• Remote State Storage
• Use Azure Storage or Terraform Cloud as backend
• Share states between teams and CI/CD runs
• Terraform Modules
• Module = container for multiple resources that are used together
• Automated testing
• How do I continuously integrate Terraform Infrastructure as Code ?
Demonstration
Terraform on Azure – Reference Architecture
https://github.com/jcorioland/terraform-azure-reference
Questions/Follow up
Julien Corioland
@jcorioland

Terraform on Azure

  • 1.
    Post HashiConf EUMeetup 07/11/2019 Amsterdam
  • 2.
    Julien Corioland • SeniorSoftware Engineer @ Microsoft • Paris, France • https://blog.jcorioland.io • https://github.com/jcorioland • https://twitter.com/jcorioland
  • 3.
    Infrastructure as Code Thinkabout immutable and disposable infrastructure.
  • 4.
    Pet vs Cattle PetModel • You care so much about your infrastructure that you give it lovely names • Earth, Jupiter, Mars … • Goals: each server part of your infrastructure should be up 24/7 Cattle Model • You stop naming your servers and consider it as “disposable” infrastructure • front-01, front-02, front- 03… • Goals: n servers are part of the infrastructure 24/7
  • 5.
    Cloud platforms makeit possible All is about automation Imperative (Bash/PS scripts) Declarative (ARM, Terraform…) Idempotency
  • 6.
    Infrastructure = code •Stored in the source code repository (GitHub, Azure Repos…), it’s just text! • Same lifecycle • You update the code, you update the infrastructure • Continuous Integration / Continuous Deployment • Versioning • Labels / Rollbacks • Also valid for configuration (configuration as code)
  • 7.
    Terraform Write, Plan, andCreate Infrastructure as Code
  • 8.
    What is Terraform? •An open source tool/language (HCL) developed by HashiCorp • Allows to write, plan and create infrastructure as code • Common language for different providers • Azure • AWS • Google • Kubernetes • … • Same workflow / pipeline • But different resources!
  • 9.
  • 10.
  • 11.
  • 12.
    Advanced Workloads • RemoteState Storage • Use Azure Storage or Terraform Cloud as backend • Share states between teams and CI/CD runs • Terraform Modules • Module = container for multiple resources that are used together • Automated testing • How do I continuously integrate Terraform Infrastructure as Code ?
  • 13.
    Demonstration Terraform on Azure– Reference Architecture https://github.com/jcorioland/terraform-azure-reference
  • 14.