Terraform 1.1 moves forward with refactoring helpers and native Terraform Cloud integration

Terraform 1.1 moves forward with refactoring helpers and native Terraform Cloud integration

A good half year after Terraform hit its first major release, the team behind the infrastructure as a code project has pushed version 1.1 into the open, highlighting new refactoring mechanisms and a native Terraform Cloud integration.

To connect to Terraform Cloud, teams can add a cloud block to their Terraform settings block instead of setting up a remote resource. This approach allows them to use the CLI to pass input variables to Terraform Cloud, which simplifies CLI-based workflows, and adds options for better workspace management via dedicated workspace tags. And if that doesn’t sound useful enough, the integration is also supposed to produce more helpful error messages.

The newly added moved blocks meanwhile are meant to free module users of the burden of having to manually run the terraform state mv command after upgrading a module. Instead, they provide module creators with a way of pointing out if resource or instance addresses have changed, which Terraform can then use during the planning stage for migrating objects accordingly.

In terms of configuration, Terraform 1.1 allows developers to define if a variable is allowed to be null within a module by setting nullable = false, and utilises the precise type information for resources in the config validation phase. Should a configuration change prompt the tool to destroy a resource instance, terraform plan and apply will notify the user of this fact in case it was a mistake. 

Other than that, the interactive console has started to offer a type() function to inspect a value’s type while debugging. Windows 10 users get to see some improvements when using SSH agent authentication mode, as Terraform learned to detect the SSH agent provided by the operating system’s built-in OpenSSH client.

Teams who have been using Terraform for a while already should be aware that some under-the-hood changes will lead to terraform state mv throwing an error when options -backup or -backup-out are used without -state when working on remote backends now. Also, terraform graph no longer offers -type=validate and -type=eval options, as the Terraform developers felt that the modes’ functionalities are sufficiently covered by the standard plan graph creation behaviour. 

Other things to take into account before making the jump to version 1.1 can be found in the upgrade notes.