Terraform 1.5
This overview applies when the project's target Terraform version is at least 1.5.
Configuration and validation
- Top-level
checkblocks can continuously validate infrastructure independently of resource lifecycle operations. Each contains one or moreassertblocks and may contain a scoped data source; failed checks warn without halting the operation. - Configuration-driven
importblocks make adoption of existing resources visible in plans. Terraform 1.5 requires a literal string forid; expression support arrives in Terraform 1.6. terraform plan -generate-config-out=PATHcan generate initial resource configuration for import targets that have no resource block. Generated configuration requires review before apply.
import {
to = aws_s3_bucket.logs
id = "company-logs"
}
Functions and operations
plantimestamp()returns a stable timestamp selected during planning, unliketimestamp(), whose result is determined during apply.strcontains(string, substring)tests whether a string contains a substring.- Local apply operations periodically persist state snapshots and attempt another snapshot after an interrupt, reducing the potential loss window during an aborted apply.
Compatibility
- Terraform 1.5 is the final minor series supporting macOS 10.13 and 10.14 and legacy Windows versions older than Windows 10 or Windows Server 2016.