Terraform 1.7
This overview applies when the project's target Terraform version is at least 1.7.
Testing
- Terraform tests can mock providers with
mock_provider, replace individual resources or data sources withoverride_resourceandoverride_data, and replace whole module results withoverride_module. - Mock providers allow apply-mode module tests without real provider credentials or remote infrastructure.
Refactoring
- A
removedblock records that a resource or module call left configuration and selects whether Terraform should destroy the remote object or only forget it from state. - Configuration-driven removal is planned and applied, providing a reviewable alternative to an immediate
terraform state rmoperation.
removed {
from = aws_instance.legacy
lifecycle {
destroy = false
}
}
Behaviour and migration
nonsensitiveaccepts values that are already non-sensitive instead of raising an error.terraform graphdefaults to a simplified resource relationship graph.terraform graph -type=planretains the more detailed plan graph.- The S3 backend adopts the standard AWS credential chain by default; the legacy workflow is deprecated.
- State interoperability involving input validations requires Terraform 1.3.10, 1.4.7, or 1.5.7 when those older minor series exchange state with Terraform 1.7.