Which statement best describes the declarative approach in Infrastructure as Code (IaC)?
Think about whether you describe the final setup or the steps to get there.
Declarative IaC means you declare what you want the infrastructure to look like. The tool then figures out how to make it happen. This is different from imperative, where you specify exact steps.
Which of the following Terraform configurations shows an imperative style rather than declarative?
Note: Terraform is declarative by design, but consider which option mimics imperative behavior.
Imperative style involves explicit commands or scripts executed step-by-step.
Using local-exec provisioners runs explicit commands during deployment, which is more imperative. Terraform resource blocks are declarative.
What does the terraform plan command do in the context of declarative Infrastructure as Code?
Think about how Terraform previews changes before applying them.
terraform plan compares the current infrastructure state with the desired state declared in code and shows what changes will be made.
Which security risk is more likely when using imperative Infrastructure as Code compared to declarative?
Consider how manual steps can cause mistakes.
Imperative IaC requires explicit commands; missing or incorrect steps can cause security gaps. Declarative IaC reduces this risk by defining the desired state.
You manage a large cloud infrastructure that changes frequently. Which approach is best to ensure reliable, repeatable deployments and why?
Think about scalability, repeatability, and error reduction.
Declarative IaC is best for large, changing environments because it automates state management and reduces manual errors. Imperative scripts can become complex and error-prone.