Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform
Use Infrastructure as Code (IaC) to automate, test, and streamline infrastructure for business-critical systems.

In Infrastructure as Code, Patterns and Practices you will learn how to:

    Optimize infrastructure for modularity and isolate dependencies
    Test infrastructure configuration
    Mitigate, troubleshoot, and isolate failed infrastructure changes
    Collaborate across teams on infrastructure development
    Update infrastructure with minimal downtime using blue-green deployments
    Scale infrastructure systems supporting multiple business units
    Use patterns for provisioning tools, configuration management, and image building
    Deliver secure infrastructure configuration to production

Infrastructure as Code, Patterns and Practices teaches you to automate infrastructure by applying changes in a codified manner. You’ll learn how to create, test, and deploy infrastructure components in a way that’s easy to scale and share across an entire organization. The book is full of flexible automation techniques that work whether you’re managing your personal projects or making live network changes across a large enterprise.

A system administrator or infrastructure engineer will learn essential software development practices for managing IaC, while developers will benefit from in-depth coverage of assembling infrastructure as part of DevOps culture. While the patterns and techniques are tool agnostic, you’ll appreciate the easy-to-follow examples in Python and Terraform.

About the technology
Infrastructure as Code is a set of practices and processes for provisioning and maintaining infrastructure using scripts, configuration, or programming languages. With IaC in place, it’s easy to test components, implement features, and scale with minimal downtime. Best of all, since IaC follows good development practices, you can make system-wide changes with just a few code commits!

About the book
Infrastructure as Code, Patterns and Practices teaches flexible techniques for building resilient, scalable infrastructure, including structuring and sharing modules, migrating legacy systems, and more. Learn to build networks, load balancers, and firewalls using Python and Terraform, and confidently update infrastructure while your software is running. You’ll appreciate the expert advice on team collaboration strategies to avoid instability, improve security, and manage costs.

What's inside

    Optimize infrastructure for modularity and isolate dependencies
    Mitigate, troubleshoot, and isolate failed infrastructure changes
    Update infrastructure with minimal downtime using blue-green deployments
    Use patterns for provisioning tools, configuration management, and image building

About the reader
For infrastructure or software engineers familiar with Python, provisioning tools, and public cloud providers.

About the author
Rosemary Wang is an educator, contributor, writer, and speaker. She has worked on many infrastructure as code projects, and open source tools such as Terraform, Vault, and Kubernetes.

Table of Contents

PART 1 FIRST STEPS
1 Introducing infrastructure as code
2 Writing infrastructure as code
3 Patterns for infrastructure modules
4 Patterns for infrastructure dependencies
PART 2 SCALING WITH YOUR TEAM
5 Structuring and sharing modules
6 Testing
7 Continuous delivery and branching models
8 Security and compliance
PART 3 MANAGING PRODUCTION COMPLEXITY
9 Making changes
10 Refactoring
11 Fixing failures
12 Cost of cloud computing
13 Managing tools
1141372465
Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform
Use Infrastructure as Code (IaC) to automate, test, and streamline infrastructure for business-critical systems.

In Infrastructure as Code, Patterns and Practices you will learn how to:

    Optimize infrastructure for modularity and isolate dependencies
    Test infrastructure configuration
    Mitigate, troubleshoot, and isolate failed infrastructure changes
    Collaborate across teams on infrastructure development
    Update infrastructure with minimal downtime using blue-green deployments
    Scale infrastructure systems supporting multiple business units
    Use patterns for provisioning tools, configuration management, and image building
    Deliver secure infrastructure configuration to production

Infrastructure as Code, Patterns and Practices teaches you to automate infrastructure by applying changes in a codified manner. You’ll learn how to create, test, and deploy infrastructure components in a way that’s easy to scale and share across an entire organization. The book is full of flexible automation techniques that work whether you’re managing your personal projects or making live network changes across a large enterprise.

A system administrator or infrastructure engineer will learn essential software development practices for managing IaC, while developers will benefit from in-depth coverage of assembling infrastructure as part of DevOps culture. While the patterns and techniques are tool agnostic, you’ll appreciate the easy-to-follow examples in Python and Terraform.

About the technology
Infrastructure as Code is a set of practices and processes for provisioning and maintaining infrastructure using scripts, configuration, or programming languages. With IaC in place, it’s easy to test components, implement features, and scale with minimal downtime. Best of all, since IaC follows good development practices, you can make system-wide changes with just a few code commits!

About the book
Infrastructure as Code, Patterns and Practices teaches flexible techniques for building resilient, scalable infrastructure, including structuring and sharing modules, migrating legacy systems, and more. Learn to build networks, load balancers, and firewalls using Python and Terraform, and confidently update infrastructure while your software is running. You’ll appreciate the expert advice on team collaboration strategies to avoid instability, improve security, and manage costs.

What's inside

    Optimize infrastructure for modularity and isolate dependencies
    Mitigate, troubleshoot, and isolate failed infrastructure changes
    Update infrastructure with minimal downtime using blue-green deployments
    Use patterns for provisioning tools, configuration management, and image building

About the reader
For infrastructure or software engineers familiar with Python, provisioning tools, and public cloud providers.

About the author
Rosemary Wang is an educator, contributor, writer, and speaker. She has worked on many infrastructure as code projects, and open source tools such as Terraform, Vault, and Kubernetes.

Table of Contents

PART 1 FIRST STEPS
1 Introducing infrastructure as code
2 Writing infrastructure as code
3 Patterns for infrastructure modules
4 Patterns for infrastructure dependencies
PART 2 SCALING WITH YOUR TEAM
5 Structuring and sharing modules
6 Testing
7 Continuous delivery and branching models
8 Security and compliance
PART 3 MANAGING PRODUCTION COMPLEXITY
9 Making changes
10 Refactoring
11 Fixing failures
12 Cost of cloud computing
13 Managing tools
43.99 In Stock
Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform

Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform

by Rosemary Wang
Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform

Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform

by Rosemary Wang

eBook

$43.99 

Available on Compatible NOOK devices, the free NOOK App and in My Digital Library.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

Use Infrastructure as Code (IaC) to automate, test, and streamline infrastructure for business-critical systems.

In Infrastructure as Code, Patterns and Practices you will learn how to:

    Optimize infrastructure for modularity and isolate dependencies
    Test infrastructure configuration
    Mitigate, troubleshoot, and isolate failed infrastructure changes
    Collaborate across teams on infrastructure development
    Update infrastructure with minimal downtime using blue-green deployments
    Scale infrastructure systems supporting multiple business units
    Use patterns for provisioning tools, configuration management, and image building
    Deliver secure infrastructure configuration to production

Infrastructure as Code, Patterns and Practices teaches you to automate infrastructure by applying changes in a codified manner. You’ll learn how to create, test, and deploy infrastructure components in a way that’s easy to scale and share across an entire organization. The book is full of flexible automation techniques that work whether you’re managing your personal projects or making live network changes across a large enterprise.

A system administrator or infrastructure engineer will learn essential software development practices for managing IaC, while developers will benefit from in-depth coverage of assembling infrastructure as part of DevOps culture. While the patterns and techniques are tool agnostic, you’ll appreciate the easy-to-follow examples in Python and Terraform.

About the technology
Infrastructure as Code is a set of practices and processes for provisioning and maintaining infrastructure using scripts, configuration, or programming languages. With IaC in place, it’s easy to test components, implement features, and scale with minimal downtime. Best of all, since IaC follows good development practices, you can make system-wide changes with just a few code commits!

About the book
Infrastructure as Code, Patterns and Practices teaches flexible techniques for building resilient, scalable infrastructure, including structuring and sharing modules, migrating legacy systems, and more. Learn to build networks, load balancers, and firewalls using Python and Terraform, and confidently update infrastructure while your software is running. You’ll appreciate the expert advice on team collaboration strategies to avoid instability, improve security, and manage costs.

What's inside

    Optimize infrastructure for modularity and isolate dependencies
    Mitigate, troubleshoot, and isolate failed infrastructure changes
    Update infrastructure with minimal downtime using blue-green deployments
    Use patterns for provisioning tools, configuration management, and image building

About the reader
For infrastructure or software engineers familiar with Python, provisioning tools, and public cloud providers.

About the author
Rosemary Wang is an educator, contributor, writer, and speaker. She has worked on many infrastructure as code projects, and open source tools such as Terraform, Vault, and Kubernetes.

Table of Contents

PART 1 FIRST STEPS
1 Introducing infrastructure as code
2 Writing infrastructure as code
3 Patterns for infrastructure modules
4 Patterns for infrastructure dependencies
PART 2 SCALING WITH YOUR TEAM
5 Structuring and sharing modules
6 Testing
7 Continuous delivery and branching models
8 Security and compliance
PART 3 MANAGING PRODUCTION COMPLEXITY
9 Making changes
10 Refactoring
11 Fixing failures
12 Cost of cloud computing
13 Managing tools

Product Details

ISBN-13: 9781638351115
Publisher: Manning
Publication date: 09/20/2022
Sold by: SIMON & SCHUSTER
Format: eBook
Pages: 400
File size: 23 MB
Note: This product may take a few minutes to download.

About the Author

Rosemary Wang is a developer advocate at Hashicorp. She is an educator, contributor, writer, and speaker of many infrastructure as code projects, including HashiCorp Terraform, HashiCorp Vault, and Kubernetes.

Table of Contents

Preface xi

Acknowledgments xiii

About this book xv

About the author xix

About the cover illustration xx

Part 1 First steps 1

1 Introducing infrastructure as code 3

1.1 What is infrastructure? 5

1.2 What is infrastructure as code? 7

Manual configuration of infrastructure 7

Infrastructure as code 8

What is not infrastructure as code? 10

1.3 Principles of infrastructure as code 11

Reproducibility 11

Idempotency 13

Composability 15

Evolvability 16

Applying the principles 18

1.4 Why use infrastructure as code? 19

Change management 19

Return on time investment 20

Knowledge sharing 21

Security 22

1.5 Tools 23

Examples in this book 23

Provisioning 25

Configuration management 26

Image building 27

2 Writing infrastructure as code 29

2.1 Expressing infrastructure change 31

2.2 Understanding immutability 33

Remediating out-of band changes 35

Migrating to infrastructure as code 37

2.3 Writing clean infrastructure as code 44

Version control communicates context 44

Linting and formatting 45

Naming resources 46

Variables and constants 47

Parametrize dependencies 48

Keeping it a secret 52

3 Patterns for infrastructure modules 55

3.1 Singleton 56

3.2 Composite 59

3.3 Factory 62

3.4 Prototype 65

3.5 Builder 69

3.6 Choosing a pattern 75

4 Patterns for infrastructure dependencies 80

4.1 Unidirectional relationships 81

4.2 Dependency injection 83

Inversion of control 83

Dependency inversion 85

Applying dependency injection 91

4.3 Facade 94

4.4 Adapter 97

4.5 Mediator 103

4.6 Choosing a pattern 106

Part 2 Scaling with your team 109

5 Structuring and sharing modules 111

5.1 Repository structure 112

Single repository 112

Multiple repositories 117

Choosing a repository structure 120

5.2 Versioning 125

5.3 Releasing 128

5.4 Sharing modules 131

6 Testing 134

6.1 The infrastructure testing cycle 136

Static analysis 137

Dynamic analysis 138

Infrastructure testing environments 139

6.2 Unit tests 140

Testing infrastructure configuration 141

Testing domain-specific languages 144

When should you write unit tests? 147

6.3 Contract tests 148

6.4 Integration tests 151

Testing modules 151

Testing configuration for environments 154

Testing challenges 155

6.5 End-to-end tests 157

6.6 Other tests 159

6.7 Choosing tests 161

Module-testing strategy 162

Configuration testing strategy 163

Identifying useful tests 165

7 Continuous delivery and branching models 167

7.1 Delivering changes to production 169

Continuous integration 169

Continuous delivery 171

Continuous deployment 172

Choosing a delivery approach 174

Modules 178

7.2 Branching models 180

Feature-based development 181

Trunk-based development 185

Choosing a branching model 187

7.3 Peer review 191

7.4 GitOps 196

8 Security and compliance 199

8.1 Managing access and secrets 200

Principle of least privilege 201

Protecting secrets in configuration 203

8.2 Tagging infrastructure 205

8.3 Policy as code 208

Policy engines and standards 209

Security tests 211

Policy tests 214

Practices and patterns 215

Part 3 Managing Production Complexity 221

9 Making changes 223

9.1 Pre-change practices 225

Following a checklist 225

Adding reliability 227

9.2 Blue-green deployment 232

Deploying the green infrastructure 234

Deploying high-level dependencies to the green infrastructure 235

Using a canary deployment to the green infrastructure 238

Performing regression testing 243

Deleting the blue infrastructure 245

Additional considerations 247

9.3 Stateful infrastructure 248

Blue-green deployment 248

Update delivery pipeline 249

Canary deployment 250

10 Refactoring 253

10.1 Minimizing the refactoring impact 254

Reduce blast radius with rolling updates 255

Stage refactoring with feature flags 256

10.2 Breaking down monoliths 262

Refactor high-level resources 263

Refactor resources with dependencies 275

Repeat refactoring workflow 280

11 Fixing failures 283

11.1 Restoring functionality 284

Rolling forward to revert changes 285

Rolling forward for new changes 286

11.2 Troubleshooting 287

Check for drift 288

Check for dependencies 289

Check for differences in environments 292

11.3 Fixing 294

Reconcile drift 294

Reconcile differences in environments 297

Implement the original change 298

12 Cost of cloud computing 301

12.1 Manage cost drivers 302

Implement tests to control cost 304

Automate cost estimation 308

12.2 Reduce cloud waste 315

Stop untagged or unused resources 315

Start and stop resources on a schedule 316

Choose the correct resource type and size 318

Enable autoscaling 320

Seta resource expiration tag 322

12.3 Optimize cost 326

Build environments on demand 327

Use multiple clouds 328

Assess data transfer between regions and clouds 329

Test in production 330

13 Managing tools 333

13.1 Using open source tools and modules 334

Functionality 334

Security 336

Life cycle 337

13.2 Upgrading tools 339

Pre-upgrade checklist 340

Backward compatibility 341

Breaking changes in upgrades 343

13.3 Replacing tools 346

New tool supports import 346

No import capability 347

13.4 Event-driven IaC 349

Appendix A Running examples 353

Appendix B Solutions to exercises 365

Index 373

From the B&N Reads Blog

Customer Reviews