Talk given at Coding Leipzig Meetup (8th August, 2018).
Why infrastructure should be managed as code (IaC), a small intro to the IaC-tooling Terraform (and Packer), and a demo that shows how to use Terraform to deploy a good old LAMP Stack into the Cloud by the push of a button (https://github.com/cloudetc/lamp-stack-for-aws).
6. ● Automation (scalability)
● Reuse (don’t reinvent the wheel)
● Reproducibility (test once use many)
● Versioning (rollbacks)
● Team collaboration (no single point-of-failure)
● Source of truth (documentation)
6
24. Terraform ...
1. is cloud-agnostic (supports AWS, Google Cloud, Azure, DNSimple, etc.)
2. is open-source (possible to write custom providers in Go)
3. is under active development (coverage of missing AWS components,
improving all the time)
4. is declarative
5. manages dependencies automatically
6. can visualize the dependency graph
7. executes in parallel
24
25. Terraform ...
8. has a separate planning step
(generates an execution plan that shows exactly what it will do)
9. applies changes incrementally
10. offers readable and easy to work with DSL, called HCL
(100% translatable into JSON)
11. has tool integration (e.g., IntelliJ Plugin)
12. “feels just right” to handle and expand big projects
(LAMP Stack example in Cloud formation is one JSON file with >1000 LoC)
25
26. Infrastructure as Code
Configuration management
● Provision software on machines
● Tools: Puppet, Chef
Orchestration
● Provision the machines themselves,
and infrastructure around them
● Tools: Hashicorp’s Terraform & Packer, Cloudformation
26
27. Packer ...
● automates creation of machine images
● is provider-agnostic
● allows modern configuration
management (Chef, Puppet, Shell …)
● improves testability and robustness
(test once, use many)
ELB
27
28. Photo credits
● Photo by Rory Björkman on Unsplash
● Photo by Ilya Pavlov on Unsplash
● Photo by Jelleke Vanooteghem on Unsplash
● Photo by Samuel Zeller on Unsplash
28