Upgrade to TF version 1.5.3
Background
Cumulus pins its support to a specific version of Terraform see: deployment documentation. The reason for only supporting one specific Terraform version at a time is to avoid deployment errors than can be caused by deploying to the same target with different Terraform versions as a rollback to a previous Terraform version is not possible.
Cumulus is upgrading its supported version of Terraform from 0.13.6 to 1.5.3. This document contains instructions on how to perform the upgrade for your deployments.
Prerequisites
- Follow the Terraform guidance for what to do before upgrading, notably ensuring that you have no pending changes to your Cumulus deployments before proceeding.
- You should do a
terraform plan
to see if you have any pending changes for your deployment (for thedata-persistence-tf
,cumulus-tf
andrds-cluster-tf
modules), and if so, run aterraform apply
before doing the upgrade to Terraform 1.5.3
- You should do a
- Review the Terraform v1.5 release notes to prepare for any breaking changes that may affect your custom deployment code. Cumulus' deployment code has already been updated for compatibility with version 1.5.
- Install Terraform version 1.5.3. We recommend using Terraform Version Manager tfenv to manage your installed versons of Terraform, but this is not required.
Upgrade your deployment
Ensure that you are running Terraform 1.5.3 by running
terraform --version
. If you are usingtfenv
, you can switch versions by runningtfenv use 1.5.3
.For the
data-persistence-tf
andcumulus-tf
directories (andrds-cluster-tf
if neccessary), take the following steps:Run
terraform init --reconfigure
. The--reconfigure
flag is required, otherwise you might see an error like:Error: Failed to decode current backend config
The backend configuration created by the most recent run of "terraform init"
could not be decoded: unsupported attribute "lock_table". The configuration
may have been initialized by an earlier version that used an incompatible
configuration structure. Run "terraform init -reconfigure" to force
re-initialization of the backend.Run
terraform apply
to perform a deployment.cautionEven if Terraform says that no resource changes are pending, running the
apply
using Terraform version 1.5.3 will modify your backend state from version 0.13.6 to version 1.5.3 without requiring approval. Updating the backend state is a necessary part of the version 1.5.3 upgrade, but it is not completely transparent.