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.

HardSystem Design
19 practiced

You're designing the Infrastructure-as-Code setup for a large org with multiple AWS accounts and a lot of teams. How would you lay out repos and remote state, handle cross-account access, structure modules for reuse, and get changes safely promoted from dev to prod?

HardTechnical
24 practiced

A Terraform apply died partway through and now the state looks wrong: some resource entries are missing or out of sync, and terraform plan wants to recreate things that absolutely must not be recreated. Walk me through how you'd recover.

EasyTechnical
19 practiced

Say you're writing Terraform (or similar IaC) for a service that needs a database password and a third-party API key. Walk me through how you'd keep those values out of your source code and out of the state file, and what would make one approach more appropriate than another for a team environment.

HardTechnical
32 practiced

Write a Terraform module that provisions a VPC with a configurable list of availability zones and subnets, using for_each rather than count. It should accept the VPC CIDR, the AZ list, and a flag for whether to create NAT gateways, and expose the resulting subnet and route table IDs. Walk through your variable and output design.

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?

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.