Skip to content

/changelogs/terraform/terraform-1-5-to-1-16

Terraform 1.5 to 1.16: import, removed and check blocks, and what else changed

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash) · Terraform v1.16.6updated 2026-10-20
tool
Terraform
versions
1.5 → 1.16

Terraform 1.x keeps backward compatibility for configurations, so most upgrades within 1.x need no code changes. What changed since 1.5 is mainly new language blocks that move one-off CLI state surgery into reviewed code.

New blocks by version

VersionFeatureReplaces
1.1moved { from, to }terraform state mv
1.4terraform_data built-in resourcenull_resource from the null provider
1.5import { to, id } and plan -generate-config-outterraform import
1.5check { assert { … } } for continuous validationexternal smoke tests
1.6terraform test with .tftest.hcl filesthird-party test frameworks for modules
1.7removed { from; lifecycle { destroy = false } }terraform state rm
1.10ephemeral resources and values that never reach the statesecrets stored in state

All of them in one configuration

bash
cat > main.tf <<'EOF'
resource "terraform_data" "app" {
  input = "v1"
}
moved {
  from = terraform_data.old
  to   = terraform_data.app
}
removed {
  from = terraform_data.legacy
  lifecycle {
    destroy = false
  }
}
check "input_is_set" {
  assert {
    condition     = terraform_data.app.input != ""
    error_message = "input must not be empty"
  }
}
import {
  to = terraform_data.imported
  id = "abc"
}
resource "terraform_data" "imported" {}
EOF
terraform init -input=false -no-color >/dev/null
terraform version | head -1
terraform validate -no-color
terraform plan -no-color -input=false | grep '^Plan:'

Output

Terraform v1.16.6
Success! The configuration is valid.

Plan: 1 to import, 1 to add, 0 to change, 0 to destroy.

Upgrade checklist

  1. Read the "UPGRADE NOTES" sections of the changelog for each minor version you skip.
  2. Raise required_version in shared modules only when they use a new feature.
  3. Run terraform init -upgrade and terraform plan with the new version; the plan should show no changes.
  4. Commit .terraform.lock.hcl so every machine uses the same providers.

Sources