mediumMultiple Choice
Cloud Digital Leader Practice Question: 'infrastructure as code' (IaC), and what problem…
What is 'infrastructure as code' (IaC), and what problem does it solve compared to manually configuring cloud resources through a web console?
⚠ Common exam trap
Google Cloud often tests the misconception that IaC is a specific tool or scripting language, rather than a methodology for reproducible infrastructure management, leading candidates to confuse it with automation scripts or discovery tools.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
IaC defines infrastructure in version-controlled code files, enabling reproducible, automated, and consistent environment provisioning versus error-prone manual console configuration.
Infrastructure as Code (IaC) is the practice of managing and provisioning cloud resources through machine-readable definition files (e.g., YAML, JSON, HCL) rather than through manual processes like clicking in a web console. The core problem it solves is eliminating the error-prone, inconsistent, and non-reproducible nature of manual configuration by enabling version-controlled, automated, and repeatable deployments. Tools like Terraform, AWS CloudFormation, and Azure Resource Manager (ARM) templates are common IaC implementations that enforce desired state configuration and drift detection.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
IaC is a programming language specifically for writing cloud applications.
Why it's wrong here
IaC is a configuration management practice, not a programming language for building applications. It defines the environment—networks, compute, storage, IAM—that applications run in, using purpose-built domain-specific tools like HCL or CloudFormation templates. Application code, by contrast, implements business logic and is typically written in general-purpose languages such as Go, Java, or Python; conflating the two confuses the separation between application binaries and the declarative infrastructure they run on.
- ✓
IaC defines infrastructure in version-controlled code files, enabling reproducible, automated, and consistent environment provisioning versus error-prone manual console configuration.
Why this is correct
Infrastructure as Code codifies the desired state of cloud resources in human-readable configuration files such as Terraform HCL or CloudFormation YAML, stored in Git alongside application code. Because the definition is versioned, teams can review, roll back, and audit every change; the same code repeatedly produces equivalent environments, eliminating the inconsistencies and human error inherent in clicking through the cloud console. Automated pipelines can run plan/apply steps, making provisioning repeatable, testable, and faster than manual configuration.
- ✗
IaC is a tool that automatically discovers and documents existing cloud infrastructure.
Why it's wrong here
This describes discovery or inventory tools, not IaC. Products like Google Cloud Asset Inventory, AWS Config, or Terraform's import command inspect and document current resources, but IaC works in the opposite direction: it declares the target end-state before anything is created. IaC is prescriptive—it defines what infrastructure should exist—whereas discovery tools are descriptive and reflect reality, which may have drifted from the source of truth.
- ✗
IaC requires writing custom Python scripts for every cloud resource type.
Why it's wrong here
IaC does not mandate custom Python scripts per resource. Tools such as Terraform, Pulumi, and AWS CDK wrap cloud provider APIs behind declarative configuration (HCL, YAML, or a higher-level SDK), so standard resources like VPCs, databases, and buckets are described as resource blocks or declarations. Pulumi or CDK allow Python or TypeScript for complex logic, but that is one optional pattern, not a requirement; the core value is working from a desired-state specification rather than writing imperative scripts for every API call.
Go deeper
Related to this question
Learn chapter
Rightsizing and Resource Optimisation
Key term
Terraform
Terraform is an infrastructure-as-code tool that lets you define and manage your IT infrastructure using configuration files instead of manual processes.
Key term
Infrastructure as code
Infrastructure as code (IaC) is the practice of managing and provisioning IT infrastructure through machine-readable definition files, rather than through physical hardware configuration or interactive configuration tools.
About these practice questions
Courseiva writes every GCDL question from scratch — 848 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This GCDL practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the GCDL exam.