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.

MediumTechnical
21 practiced

A service stores database credentials and API keys in Terraform variables today, and the team is worried about exposure. How would you redesign the workflow so Terraform can still provision the stack without making secrets visible to everyone who can read the repo or the state?

MediumTechnical
16 practiced

Walk me through blue-green versus canary deployment from an infrastructure perspective; when would you reach for each? Think about traffic routing, resource duplication, cost, and what gets harder when a database schema change is part of the rollout.

EasyTechnical
21 practiced

What does terraform import actually do, and can you think of a time you'd reach for it instead of just writing a fresh resource block?

HardTechnical
24 practiced

A Terraform run needs to hand a newly provisioned service a database credential or similar application secret. How would you get that credential to the resource without it ever being a long-lived static value baked into your configuration or left sitting in state, and what has to happen when that credential eventually needs to be renewed?

MediumTechnical
21 practiced

You need one module to create a resource only when a feature flag is enabled, and also create one related object per item in a caller-provided list. How would you keep that configuration maintainable as the list grows or changes order over time?

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.