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.

EasyTechnical
23 practiced

A teammate hands you a Terraform file that provisions a new environment from scratch. Before it can be applied to a shared cloud account, what would you review in the provider configuration, resource definitions, variables, and outputs to make sure the configuration is readable, parameterized, and not hiding risky assumptions?

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.

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?

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

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 18 Infrastructure as Code and Automation interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.