liveBook · Manning

Testing in production

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

Testing in production is the practice of validating software or infrastructure behavior in the live production environment under controlled conditions.

Testing in production validates software or infrastructure against production data and systems under controlled conditions. For infrastructure as code, it can expose broken systems without maintaining a separate testing environment. section 12.3.4

A controlled infrastructure test can proceed as follows:

  • Stage a second set of resources containing the intended changes. section 12.3.4
  • Hide the changes behind a feature flag, then direct application and user traffic to them. section 12.3.4
  • Verify functionality while both resource sets run simultaneously, then remove the old resources after the observation period. section 12.3.4

Conference video service

A video service team tests infrastructure changes with blue-green resources and a feature flag, avoiding a separate testing environment while controlling exposure. section 12.3.4

Figure 12.15 Testing in production for IaC applies blue-green deployments and feature flagging for a set of resources.

Shows how blue-green deployments and feature flagging control production exposure for infrastructure changes. section 12.3.4

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

How deep it goes
Explains definitions, blue-green execution, feature flags, canaries, and roll-forward recovery, but not detailed implementation code.
Examples
Uses a conference video service, parallel resource sets, production traffic switching, and delayed deletion of old infrastructure.
What you can do after
Apply via blue-green deployments and feature flags to validate infrastructure changes against production systems.
How it connects
Connects infrastructure as code with blue-green deployments, feature flagging, canary deployments, and cost optimization.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform. The section links point to the parts of the book it draws on.