Infrastructure as Code and Automation Questions

Defining, provisioning, and automating infrastructure programmatically. Covers declarative IaC with Terraform and comparable tools like CloudFormation (resource and provider model, state management and remote backends, module design and reuse, workspaces, drift detection, and safe plan/apply workflows), plus the broader automation discipline: provisioning pipelines, golden-image and machine-image building, scripting glue, self-service platforms, and end-to-end environment stand-up. The authoring, lifecycle, and automation of infrastructure code that reduces manual toil across provisioning workflows.

HardTechnical
19 practiced

Say the database backing a high-traffic production service is provisioned and managed through your IaC pipeline, and you need to change its schema. How do you sequence the schema change against the infrastructure rollout so you don't risk data loss or downtime, and what's your fallback if something goes wrong partway through?

MediumTechnical
31 practiced

What do the Terraform lifecycle meta-arguments create_before_destroy, prevent_destroy, and ignore_changes each do? For each one, describe a real production scenario where you'd reach for it and what could go wrong if you use it carelessly.

HardSystem Design
24 practiced

You've got an existing fleet of long-running VMs that get patched in place, and you want to move them to an immutable, image-based deployment model instead. Walk through how you'd get there: building and validating the images, rolling the fleet over without a big-bang cutover, and handling the stateful pieces that can't just be thrown away and replaced.

HardTechnical
20 practiced

Before a production apply, what review and automation guardrails would you put around the Terraform workflow so an engineer can catch unexpected destroys or replacements before they reach users?

HardTechnical
19 practiced

Terraform doesn't give you an automatic transactional rollback if an apply goes wrong. What patterns do you rely on instead to safely walk back an infrastructure change, and when is automated rollback the right call versus needing a human to reconcile things by hand?

Unlock Full Question Bank

Get access to all Infrastructure as Code and Automation interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.