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
18 practiced

One of your engineers discovers that a database password ended up committed in a Terraform state file that was pushed to a shared repository. Walk me through what you'd do right away, and what you'd change afterward so it can't happen again.

MediumTechnical
34 practiced

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?

HardSystem Design
31 practiced

You're designing the secrets management layer for a company that runs infrastructure across multiple clouds and is subject to strict compliance requirements, PCI or SOC 2 for example. Walk me through how you'd architect secret storage, access control, and rotation so it satisfies both the engineers who need to use it day to day and the auditors who need to sign off on it.

HardTechnical
22 practiced

Your CI pipeline needs to authenticate to your cloud provider to run Terraform, but you don't want a long-lived access key sitting in a repo secret or environment variable. How would you design that authentication so the pipeline gets valid credentials only when it actually needs them, and how would you make sure a pull request from an untrusted fork can't get at anything sensitive?

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?

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.