Exercises
Test your practical understanding of Terraform as an infrastructure as code tool. This quiz covers initialization, execution plans, state management, resource dependencies, modules, importing resources, lifecycle controls, iteration, and drift detection. The questions combine foundational concepts with realistic scenarios that developers and IT professionals encounter when provisioning and maintaining infrastructure.
Answer the questions below and check the explanation for each answer.
0/10 answered
Auto audio on: the next questions will be read aloud when you click Continue.
terraform init prepares the working directory by configuring the backend and installing required providers and modules. It is normally run before planning or applying infrastructure changes.
terraform plan compares the desired configuration with the current state and infrastructure, then previews the actions Terraform proposes. It does not normally make those changes.
A remote backend gives team members access to centralized state. Backends that support locking can also prevent simultaneous operations from conflicting and corrupting state.
References between resource attributes create implicit dependencies. Terraform uses them to build its dependency graph and creates the virtual network before the subnet that requires its ID.
Input variables allow callers to customize a configuration without editing its logic. Outputs expose useful values after evaluation, such as an endpoint, resource ID, or module result.
Modules group related resources behind defined inputs and outputs. This supports reuse, consistency, abstraction, and easier maintenance across environments and projects.
Importing associates an existing object with a resource address in Terraform state. A matching configuration must also be created or generated so Terraform can manage the object as intended.
The prevent_destroy lifecycle rule causes Terraform to reject an operation that would destroy the protected resource. It provides a safeguard, although removing the rule removes that protection.
for_each addresses instances using map keys or set values. Stable keys reduce unintended address shifts that can occur when items in a count-based list are inserted, removed, or reordered.
Terraform normally refreshes its understanding of managed objects during planning. It can then identify drift and propose actions that reconcile the real infrastructure with the declared configuration.
Video Courses
Advanced
recommended
Thousands of online courses in video, ebooks and audiobooks.
To test your knowledge during online courses
Generated directly from your cell phone's photo gallery and sent to your email
Download our app via QR Code or the links below:.
+ 10 million
students
Free and Valid
Certificate
60 thousand free
exercises
4.8/5 rating in
app stores
Free courses in
video and ebooks