How do I upgrade to Terraform 12 incrementally? #95
-
I am on a legacy project that uses Gruntwork with an old version of Terraform and Terragrunt (0.11.x and 0.18.x). I would like to upgrade to the latest version, but I have too much infrastructure to do it all at once. Is there a way I can incrementally update my projects? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
This comment has been hidden.
This comment has been hidden.
-
There is a process we have identified for a partial migration that has worked well with a few of our customers. It involves upgrading to terragrunt 19+ first, and then taking on the terraform 12 upgrade. The reason for doing this is that the newer terragrunt features allow you to better manage cross module dependencies that are not bound by the terraform version ( Here is the rough process: Incrementally upgrade to using terragrunt 0.19+ Terragrunt 0.19 has a bunch of features that support mixed terraform versions, so your first step is to upgrade to the latest terragrunt to take advantage of those features. Here is a process for how to do this incrementally in your repo:
Once the prerequisites are done, you are ready to incrementally switch to tg19+:
Switch to using dependency blocks Terragrunt 0.19 introduced a new feature for passing outputs across modules that doesn't depend on the terraform version and remote state: dependency blocks. Using this feature, it is possible to hook up the outputs of a module using terraform 11 with a module using terraform 12. This is important because, as mentioned above, However, this is a big change for the module so you will want to do this incrementally, in isolation of terraform 12 changes.
Upgrade modules to terraform 12 Once terragrunt is upgraded and the dependency blocks are introduced, you can start to have mixed terraform version modules. At this point, you can start to incrementally upgrade your modules to terraform 0.12, in a similar fashion to terragrunt:
|
Beta Was this translation helpful? Give feedback.
There is a process we have identified for a partial migration that has worked well with a few of our customers. It involves upgrading to terragrunt 19+ first, and then taking on the terraform 12 upgrade. The reason for doing this is that the newer terragrunt features allow you to better manage cross module dependencies that are not bound by the terraform version (
terraform_remote_state
has limitations where you can't read state that is written by a different terraform version).Here is the rough process:
Incrementally upgrade to using terragrunt 0.19+
Terragrunt 0.19 has a bunch of features that support mixed terraform versions, so your first step is to upgrade to the latest terragrunt to…