liveBook · Manning

What you will learn in Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform

With examples in Python and Terraform

by Rosemary Wang

Chapter by chapter

Chapter 1: Introducing infrastructure as code

1.1 What is infrastructure? · 1.2 What is infrastructure as code? · 1.2.1 Manual configuration of infrastructure · 1.2.2 Infrastructure as code · 1.2.3 What is not infrastructure as code? · 1.3 Principles of infrastructure as code · 1.3.1 Reproducibility · 1.3.2 Idempotency · 1.3.3 Composability · 1.3.4 Evolvability · 1.3.5 Applying the principles · 1.4 Why use infrastructure as code? · 1.4.1 Change management · 1.4.2 Return on time investment · 1.4.3 Knowledge sharing · 1.4.4 Security · 1.5 Tools · 1.5.1 Examples in this book · 1.5.2 Provisioning · 1.5.3 Configuration management · 1.5.4 Image building · 1.6 Summary

What you learn in chapter 1 →

Chapter 2: Writing infrastructure as code

2.1 Expressing infrastructure change · 2.2 Understanding immutability · 2.2.1 Remediating out-of-band changes · 2.2.2 Migrating to infrastructure as code · 2.3 Writing clean infrastructure as code · 2.3.1 Version control communicates context · 2.3.2 Linting and formatting · 2.3.3 Naming resources · 2.3.4 Variables and constants · 2.3.5 Parametrize dependencies · 2.3.6 Keeping it a secret · 2.4 Summary

What you learn in chapter 2 →

Chapter 3: Patterns for infrastructure modules

3.1 Singleton · 3.2 Composite · 3.3 Factory · 3.4 Prototype · 3.5 Builder · 3.6 Choosing a pattern · 3.7 Summary

What you learn in chapter 3 →

Chapter 4: Patterns for infrastructure dependencies

4.1 Unidirectional relationships · 4.2 Dependency injection · 4.2.1 Inversion of control · 4.2.2 Dependency inversion · 4.2.3 Applying dependency injection · 4.3 Facade · 4.4 Adapter · 4.5 Mediator · 4.6 Choosing a pattern · 4.7 Summary

What you learn in chapter 4 →

Chapter 5: Structuring and sharing modules

5.1 Repository structure · 5.1.1 Single repository · 5.1.2 Multiple repositories · 5.1.3 Choosing a repository structure · 5.2 Versioning · 5.3 Releasing · 5.4 Sharing modules · 5.5 Summary

What you learn in chapter 5 →

Chapter 6: Testing

6.1 The infrastructure testing cycle · 6.1.1 Static analysis · 6.1.2 Dynamic analysis · 6.1.3 Infrastructure testing environments · 6.2 Unit tests · 6.2.1 Testing infrastructure configuration · 6.2.2 Testing domain-specific languages · 6.2.3 When should you write unit tests? · 6.3 Contract tests · 6.4 Integration tests · 6.4.1 Testing modules · 6.4.2 Testing configuration for environments · 6.4.3 Testing challenges · 6.5 End-to-end tests · 6.6 Other tests · 6.7 Choosing tests · 6.7.1 Module-testing strategy · 6.7.2 Configuration testing strategy · 6.7.3 Identifying useful tests · 6.8 Summary

What you learn in chapter 6 →

Chapter 7: Continuous delivery and branching models

7.1 Delivering changes to production · 7.1.1 Continuous integration · 7.1.2 Continuous delivery · 7.1.3 Continuous deployment · 7.1.4 Choosing a delivery approach · 7.1.5 Modules · 7.2 Branching models · 7.2.1 Feature-based development · 7.2.2 Trunk-based development · 7.2.3 Choosing a branching model · 7.3 Peer review · 7.4 GitOps · 7.5 Summary

What you learn in chapter 7 →

Chapter 8: Security and compliance

8.1 Managing access and secrets · 8.1.1 Principle of least privilege · 8.1.2 Protecting secrets in configuration · 8.2 Tagging infrastructure · 8.3 Policy as code · 8.3.1 Policy engines and standards · 8.3.2 Security tests · 8.3.3 Policy tests · 8.3.4 Practices and patterns · 8.4 Summary

What you learn in chapter 8 →

Chapter 9: Making changes

9.1 Pre-change practices · 9.1.1 Following a checklist · 9.1.2 Adding reliability · 9.2 Blue-green deployment · 9.2.1 Deploying the green infrastructure · 9.2.2 Deploying high-level dependencies to the green infrastructure · 9.2.3 Using a canary deployment to the green infrastructure · 9.2.4 Performing regression testing · 9.2.5 Deleting the blue infrastructure · 9.2.6 Additional considerations · 9.3 Stateful infrastructure · 9.3.1 Blue-green deployment · 9.3.2 Update delivery pipeline · 9.3.3 Canary deployment · 9.4 Summary

What you learn in chapter 9 →

Chapter 10: Refactoring

10.1 Minimizing the refactoring impact · 10.1.1 Reduce blast radius with rolling updates · 10.1.2 Stage refactoring with feature flags · 10.2 Breaking down monoliths · 10.2.1 Refactor high-level resources · 10.2.2 Refactor resources with dependencies · 10.2.3 Repeat refactoring workflow · 10.3 Summary

What you learn in chapter 10 →

Chapter 11: Fixing failures

11.1 Restoring functionality · 11.1.1 Rolling forward to revert changes · 11.1.2 Rolling forward for new changes · 11.2 Troubleshooting · 11.2.1 Check for drift · 11.2.2 Check for dependencies · 11.2.3 Check for differences in environments · 11.3 Fixing · 11.3.1 Reconcile drift · 11.3.2 Reconcile differences in environments · 11.3.3 Implement the original change · 11.4 Summary

What you learn in chapter 11 →

Chapter 12: Cost of cloud computing

12.1 Manage cost drivers · 12.1.1 Implement tests to control cost · 12.1.2 Automate cost estimation · 12.2 Reduce cloud waste · 12.2.1 Stop untagged or unused resources · 12.2.2 Start and stop resources on a schedule · 12.2.3 Choose the correct resource type and size · 12.2.4 Enable autoscaling · 12.2.5 Set a resource expiration tag · 12.3 Optimize cost · 12.3.1 Build environments on demand · 12.3.2 Use multiple clouds · 12.3.3 Assess data transfer between regions and clouds · 12.3.4 Test in production · 12.4 Summary

What you learn in chapter 12 →

Chapter 13: Managing tools

13.1 Using open source tools and modules · 13.1.1 Functionality · 13.1.2 Security · 13.1.3 Life cycle · 13.2 Upgrading tools · 13.2.1 Pre-upgrade checklist · 13.2.2 Backward compatibility · 13.2.3 Breaking changes in upgrades · 13.3 Replacing tools · 13.3.1 New tool supports import · 13.3.2 No import capability · 13.4 Event-driven IaC · 13.5 Summary

What you learn in chapter 13 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.