diff --git a/cli/internal/cloudcmd/tfvars.go b/cli/internal/cloudcmd/tfvars.go index a4ab3ad4c8..2d55342da2 100644 --- a/cli/internal/cloudcmd/tfvars.go +++ b/cli/internal/cloudcmd/tfvars.go @@ -64,6 +64,14 @@ func TerraformIAMUpgradeVars(conf *config.Config, fileHandler file.Handler) (ter if err := terraform.VariablesFromBytes(oldVarBytes, &oldVars); err != nil { return nil, fmt.Errorf("parsing existing IAM workspace: %w", err) } + + // Migration from the "region" to the "location" field name. + // TODO(msanft): Remove after v2.14.0 is released. + if oldVars.Region != nil && *oldVars.Region != "" && oldVars.Location == "" { + oldVars.Location = *oldVars.Region + oldVars.Region = nil + } + vars = azureTerraformIAMVars(conf, oldVars) case cloudprovider.GCP: var oldVars terraform.GCPIAMVariables diff --git a/cli/internal/terraform/variables.go b/cli/internal/terraform/variables.go index cdcbe90a55..210fa71bab 100644 --- a/cli/internal/terraform/variables.go +++ b/cli/internal/terraform/variables.go @@ -244,6 +244,9 @@ type AzureNodeGroup struct { // AzureIAMVariables is user configuration for creating the IAM configuration with Terraform on Microsoft Azure. type AzureIAMVariables struct { + // Region is the Azure location to use. (e.g. westus). + // THIS FIELD IS DEPRECATED AND ONLY KEPT FOR MIGRATION PURPOSES. DO NOT USE. + Region *string `hcl:"region" cty:"region"` // Location is the Azure location to use. (e.g. westus) Location string `hcl:"location" cty:"location"` // ServicePrincipal is the name of the service principal to use.