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.
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?
A repo has one large Terraform entrypoint that manages several environments and shared pieces of infrastructure. The team is having merge conflicts and accidental cross-environment changes. How would you reorganize the code so engineers can work in parallel with less risk?
You are moving a production environment from local state to a remote backend shared by the team. What design choices would you make around locking, access control, and failure recovery so concurrent work does not corrupt the environment?
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?
Terraform shows a live resource as missing, but the cloud console says it still exists. You suspect the object was originally created outside Terraform and later partially brought under management. How would you decide whether to import it, recreate it, or leave it alone?
Unlock Full Question Bank
Get access to all 12 Infrastructure as Code and Automation interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.