

Import is now a configuration-driven, plannable action, and is processed as part of a normal plan. Import blocks for importing infrastructure: Root module authors can now use the import block to declare their intent that Terraform adopt an existing resource. This allows practitioners to continually validate the state of their infrastructure outside the usual lifecycle management cycle.

Unlike the existing precondition and postcondition blocks, Terraform will not halt execution should the scoped data block fail or error or if any of the assertions fail. Scoped data sources match the existing data sources with the exception that they can only be referenced from within their check block. The new independent check blocks must specify at least one assert block, but possibly many, each one with a condition expression and an error_message expression matching the existing Custom Condition Checks.Īdditionally, check blocks can optionally load a scoped data source. Check blocks for validating infrastructure: Module and configuration authors can now write independent check blocks within their configuration to validate assertions about their infrastructure.
