Core Workflow & CLI
What is the correct order of the core Terraform workflow when starting a new configuration?
- Aapply, then plan, then init
- Bplan, then init, then destroy
- Cvalidate, then apply, then init
- Dinit, then plan, then applyCorrect
Why: The core workflow is init (initialize the working directory and download providers), plan (preview the changes Terraform will make), then apply (execute those changes). Running init first is required because plan and apply depend on the installed providers and backend configuration.
Modules & Configuration
What is a Terraform module?
- AA command-line flag that enables debug logging
- BA remote service that stores state
- CA special provider that only manages networking
- DA container for multiple resources that are used together, defined as a set of configuration filesCorrect
Why: A module is a reusable container for a group of related resources defined in a set of .tf files. Every configuration has a root module, and it can call child modules to organize and reuse code. Modules are not CLI flags, state backends, or providers.