10 Testing and refactoring

This chapter covers

  • Tainting and rotating AWS access keys provisioned by Terraform
  • Refactoring module expansions
  • Migrating state with terraform mv and terraform state
  • Importing existing resources with terraform import
  • Testing IaC with terraform-exec

The ancient Greek philosopher Heraclitus is famous for positing that “Life is flux.” In other words, change is inevitable, and to resist change is to resist the essence of our existence. Perhaps nowhere is change more pronounced than in the software industry. Due to changing customer requirements and shifting market conditions, software is guaranteed to change. If not actively maintained, software degrades over time. Refactoring and testing are steps that developers ...

Get Terraform in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.