github.com/eliastor/durgaform@v0.0.0-20220816172711-d0ab2d17673e/website/docs/language/upgrade-guides/1-1.mdx (about) 1 --- 2 page_title: Upgrading to Terraform v1.1 3 description: Upgrading to Terraform v1.1 4 --- 5 6 # Upgrading to Terraform v1.1 7 8 Terraform v1.1 is the first minor release after establishing a compatibility 9 baseline in Terraform v1.0, and so this release should not require any 10 unusual upgrade steps for most users. 11 12 However, if you are upgrading from a version earlier than v1.0 then please 13 refer to [the Terraform v1.0 upgrade guide](/language/upgrade-guides/1-0) for how to upgrade through 14 the v0 releases to reach the v1 release series. Because v1.1 is 15 backward-compatible with the v1.0 series, you can upgrade directly to the 16 latest v1.1 release, skipping the v1.0 series entirely, at any point where the 17 v1.0 upgrade guide calls for upgrading to Terraform v1.0. 18 19 Terraform v1.1 continues to honor 20 [the Terraform v1.0 Compatibility Promises](/language/v1-compatibility-promises), 21 but there are some behavior changes outside of those promises that may affect a 22 small number of users, described in the following sections. 23 24 * [Terraform requires macOS 10.13 High Sierra or later](#terraform-requires-macos-1013-high-sierra-or-later) 25 * [Preparation for removing Azure AD Graph support in the AzureRM Backend](#preparation-for-removing-azure-ad-graph-support-in-the-azurerm-backend) 26 * [Interpretation of remote file paths in the `remote-exec` and `file` provisioners](#interpretation-of-remote-file-paths-in-the-remote-exec-and-file-provisioners) 27 * [Changes to `terraform graph`](#changes-to-terraform-graph) 28 * [Changes to `terraform state mv`](#changes-to-terraform-state-mv) 29 * [Provider checksum verification in `terraform apply`](#provider-checksum-verification-in-terraform-apply) 30 31 ## Terraform requires macOS 10.13 High Sierra or later 32 33 As operating system vendors phase out support for older versions of their 34 software, the Terraform team must also phase out support in order to focus 35 on supporting newer releases. 36 37 With that in mind, the official releases of Terraform v1.1 now require 38 macOS 10.13 High Sierra or later. Earlier versions of macOS are no longer 39 supported, and Terraform CLI behavior on those earlier versions is undefined. 40 41 ## Preparation for removing Azure AD Graph support in the AzureRM Backend 42 43 [Microsoft has announced the deprecation of Azure AD Graph](https://docs.microsoft.com/en-us/graph/migrate-azure-ad-graph-faq), 44 and so Terraform v1.1 marks the first phase of a deprecation process for 45 that legacy system in [the AzureRM state storage backend](/language/settings/backends/azurerm). 46 47 During the Terraform v1.1 release the default behavior is unchanged, but you 48 can explicitly opt in to Microsoft Graph by setting 49 `use_microsoft_graph = true` inside your `backend "azurerm` block and then 50 reinitializing your working directory with `terraform init -reconfigure`. 51 52 In Terraform v1.2 we plan to change this argument to default to `true` when 53 not set, and so we strongly recommend planning to migrate to Microsoft Graph 54 in the near future to prepare for the final removal of Azure AD Graph support 55 in a later Terraform release. However, no immediate change is required before 56 upgrading to Terraform v1.1. 57 58 ## Interpretation of remote file paths in the `remote-exec` and `file` provisioners 59 60 When using Terraform's built-in `remote-exec` and `file` provisioners, there 61 are two situations where Terraform internally uses 62 [Secure Copy Protocol](https://en.wikipedia.org/wiki/Secure_copy_protocol) 63 (SCP) to upload files to the remote system at a configuration-specified 64 location: 65 66 * For [the `file` provisioner](/language/resources/provisioners/file), 67 the primary functionality is to upload a file using SCP, and the 68 `destination` argument specifies the remote path where the file is to be 69 written. 70 * For [the `remote-exec` provisioner](/language/resources/provisioners/remote-exec), 71 internally the provisioner works by uploading the given scripts to files 72 on the remote system and then executing them. By default the provisioner 73 selects a temporary filename automatically, but a module author can 74 potentially override that location using the `script_path` argument in the 75 associated [`connection` block](https://www.terraform.io/language/resources/provisioners/connection). 76 77 If you are not using either of the specific arguments mentioned above, no 78 configuration changes will be required to upgrade to Terraform v1.1. 79 80 These provisioners both passing the specified remote paths to the `scp` service 81 program on the remote system. In Terraform v1.0 and earlier, the provisioners 82 were passing the paths to `scp` in a way that was inadvertently subject to 83 _shell expansion_. That inadvertently allowed for convenient shorthands 84 such as `~/example` and `$HOME/example` to write into the target user's 85 home directory, but also offered an undesirable opportunity for accidental 86 remote code execution, such as `$(arbitrary-program)`. 87 88 In Terraform v1.1 both of the above remote path arguments are passed _verbatim_ 89 to the remote `scp` service, without any prior shell expansion. For that reason, 90 shell-defined expansion tokens such as `~` and environment variable references 91 will no longer be evaluated. 92 93 By default, the OpenSSH server and the program `scp` together already interpret 94 relative paths as relative to the target user's home directory, and so 95 module authors can specify relative paths without any special metacharacters 96 in order to request uploading into that default location: 97 98 ```hcl 99 provisioner "file" { 100 source = "local.txt" 101 destination = "remote.txt" 102 } 103 ``` 104 105 If you maintain a module that was depending on expansion of `~/`, `$HOME/`, 106 `${HOME}`/ or similar, remove that prefix so that your module instead specifies 107 just a relative path. 108 109 This is an intentional compatibility regression which we accepted after due 110 consideration of 111 [the pragmatic exceptions to our compatibility promises](/language/v1-compatibility-promises#pragmatic-exceptions). 112 Specifically, this behavior offered an unintended and non-obvious avenue for 113 arbitrary code execution on the remote system if either of the above arguments 114 were populated from outside input, and an alternative approach is available 115 which doesn't have that drawback, and this is therefore justified on security 116 grounds. 117 118 ## Changes to `terraform graph` 119 120 The `terraform graph` command exists to help with debugging and so it 121 inherently exposes some of Terraform Core's implementation details. For that 122 reason it isn't included in the v1.0 Compatibility Promises, but we still 123 aim to preserve its behavior in spirit even as Terraform Core's internal 124 design changes. 125 126 In previous releases, `terraform graph` exposed the implementation detail that 127 Terraform internally knows how to build graph types called "validate" and 128 "eval", but Terraform Core no longer exposes those graph types externally 129 and so consequently the graph command will no longer accept the options 130 `-type=validate` or `-type=eval`. 131 132 You can see a similar result to what those graph types would previously 133 produce by generating a _plan_ graph, which is the default graph type and 134 therefore requires no special `-type=...` option. 135 136 ## Changes to `terraform state mv` 137 138 Terraform's local state storage backend supports a number of 139 [legacy command line options](/language/settings/backends/local#command-line-arguments) 140 for backward-compatibility with workflows from much older versions of Terraform, 141 prior to the introduction of Backends. 142 143 Those options are not supported when using any other backend, but for many 144 commands they are simply silently ignored rather than returning an error. 145 146 Because `terraform state mv` has some extra use-cases related to migrating 147 between states, it historically had some slightly different handling of those 148 legacy options, but was not fully consistent. 149 150 From Terraform v1.1, the behavior of these options has changed as follows: 151 152 * The `-state=...` argument is allowed even when a remote backend is specified 153 in the configuration. If present, it forces the command to work in local 154 mode. 155 * The `-backup=...` and `-backup-out=...` options are allowed only if either 156 the local backend is the configuration's selected backend _or_ if you 157 specify `-state=...` to force local state operation. These options will now 158 return an error if used against a remote backend, whereas previous Terraform 159 versions ignored them entirely in that case. 160 161 There are no breaking changes to `terraform state mv`'s normal usage pattern, 162 without any special options overriding the state storage strategy. 163 164 ## Provider checksum verification in `terraform apply` 165 166 This section applies only to situations where you might generate a saved 167 plan file using `terraform plan -out=tfplan` and then separately apply it 168 using `terraform apply tfplan`. 169 170 You do not need to consider this section unless you are using a custom 171 Terraform provider which somehow modifies its own provider package contents 172 during execution. That is hypothetically possible, but not true in practice for 173 any publicly-available providers we are aware of at the time of writing this 174 guide. 175 176 Our design intent for this two-step run workflow is that the saved plan 177 records enough information for Terraform to guarantee that it's running 178 against an identical set of providers during the apply step as it was during 179 the plan step, because otherwise the different provider plugins may disagree 180 about the meaning of the planned actions. 181 182 However, prior versions of Terraform verified consistency only for the main 183 executable file representing a provider plugin, and didn't consider other 184 files that might appear alongside in the plugin package. Terraform v1.1 now 185 uses the same strategy for provider checking during apply as it does when 186 verifying provider consistency against 187 [the dependency lock file](/language/files/dependency-lock) 188 during `terraform init`, which means `terraform apply` will return an error 189 if it detects that _any_ of the files in a provider's plugin package have 190 changed compared to when the plan was created. 191 192 In the unlikely event that you _do_ use a self-modifying provider plugin, 193 please consider other solutions to achieve the goals which motivated that, 194 which do not involve the provider modifying itself at runtime. If you aren't 195 sure, please open a GitHub issue to discuss your use-case.