Using Moved Blocks in Terraform

Introduced in Terraform 1.1, the moved configuration block helps you refactor your Terraform code without breaking production. There's two primary use cases for moved blocks, refactoring published modules and refactoring large code bases. In this video, we'll focus on how you can refactor an existing deployment into modules, rename resources, and add looping without disrupting the deployed architecture. Terraform Certification Guide: https://leanpub.com/terraform-certified/ Blog post: https://nedinthecloud.com/2021/12/14/... ----------------------------------------------------------------------------------------------------- Daily Check-In: https://anchor.fm/ned-bellavance Day Two Cloud: https://daytwocloud.io Website: https://nedinthecloud.com Pluralsight: https://app.pluralsight.com/profile/a... GitHub: https://github.com/ned1313 Music by Evan Williams ©2020 Timestamps: Intro 0:00 Use Cases for Moved Blocks 1:11 Moving Resources to a Module 3:13 The state mv Command 8:03 Using Moved Blocks 10:09 Updating Resources with for_each 12:30 Caveats for the Moved Block 15:09 Outro 16:25