Question 1 · choose 1
terraform validate passes on a configuration, but the following apply fails because the requested machine type is not offered in the chosen region. Why didn't validate catch it?
- Avalidate checks only the root module and skips the resources in child modules
- Bvalidate was run without -json, which is needed for the full provider checks
- Cvalidate uses cached API results from the last plan, which predated the region change
- Dvalidate checks syntax and internal consistency only and never calls provider APIs
Show the answer and why
Avalidate checks only the root module and skips the resources in child modules
Incorrect
validate covers the whole configuration, including installed child modules.
Bvalidate was run without -json, which is needed for the full provider checks
Incorrect
-json changes the output format, not what is checked.
Cvalidate uses cached API results from the last plan, which predated the region change
Incorrect
validate does not read plans or call APIs at all.
Dvalidate checks syntax and internal consistency only and never calls provider APIs
Correct
validate verifies that the configuration is syntactically valid and internally consistent; it does not validate remote services such as provider APIs.
validate answers "is this a well-formed configuration?", not "will the platform accept it?"; only plan and apply talk to the APIs.
HashiCorp documentation