Cisco CCNA (200-301)Automation and ProgrammabilityMedium
A cloud engineer writes a configuration file that declares the desired end-state of network infrastructure, such as the number of VPCs and subnets required, without specifying the step-by-step commands to create them. Which automation approach does this describe?
- AProcedural scripting
- BImperative configuration
- CDeclarative configuration
- DManual CLI configuration
Show answer & explanationAnswer & explanation
Correct answer: C. Declarative configuration
Declarative configuration (used by tools like Terraform) specifies the desired end-state, and the tool determines the steps needed to achieve it. Imperative/procedural approaches instead require specifying the exact sequence of commands to execute.
Why the other options are wrong
- A. Procedural scripting is another term for imperative, step-based automation, not end-state declaration.
- B. Imperative configuration requires specifying exact steps/commands, which contradicts describing only the end-state.
- D. Manual CLI configuration involves entering commands directly, not writing declarative desired-state files.
Declarative vs Imperative
Declarative configuration defines the desired end-state and lets the tool figure out how to achieve it (e.g., Terraform); imperative configuration specifies exact steps to execute (e.g., traditional scripts).
- Terraform is declarative infrastructure-as-code
- Ansible playbooks are largely declarative but task order matters
- Imperative = 'how', Declarative = 'what'
Memory trick: Declarative says WHAT you want; imperative says HOW to get it.