0
0
Terraformcloud~5 mins

Declarative vs imperative IaC in Terraform - Quick Revision & Key Differences

Choose your learning style9 modes available
Recall & Review
beginner
What does declarative IaC mean?
Declarative IaC means you describe the desired final state of your infrastructure, and the tool figures out how to get there.
Click to reveal answer
beginner
What is imperative IaC?
Imperative IaC means you write step-by-step instructions telling the system exactly how to create or change resources.
Click to reveal answer
beginner
Give an example of a declarative IaC tool.
Terraform is an example of a declarative IaC tool. You write what you want, not how to do it.
Click to reveal answer
beginner
Why is declarative IaC often easier for beginners?
Because you only focus on the end result, not the detailed steps. The tool handles the complexity.
Click to reveal answer
intermediate
What is a key challenge of imperative IaC?
You must manage the exact order of steps, which can be complex and error-prone.
Click to reveal answer
Which IaC style focuses on describing the desired end state?
ADeclarative
BImperative
CProcedural
DManual
Terraform is an example of which IaC style?
AImperative
BDeclarative
CManual
DScripting
Which IaC style requires you to write step-by-step instructions?
AImperative
BAutomatic
CDescriptive
DDeclarative
What is a benefit of declarative IaC?
AIt requires detailed scripting knowledge
BYou control every step manually
CIt reduces complexity by focusing on the end state
DIt cannot be automated
Which IaC style can be more error-prone due to step ordering?
ADeclarative
BAutomatic
CNone
DImperative
Explain the difference between declarative and imperative IaC in simple terms.
Think about telling a friend what you want versus telling them exactly how to do it.
You got /4 concepts.
    Why might someone choose declarative IaC like Terraform over imperative IaC?
    Consider the benefits of focusing on the goal instead of the process.
    You got /4 concepts.