Cloud
shalla
Home
Learn
Certifications
Jobs
Roadmap
Interviews
AWS Interviews
Azure Interviews
GCP Interviews
DevOps Interviews
Cloud Engineer
Linux Interviews
Sign In
Get Started
Home
/
Directory
/
terraform
terraform Practice Questions
Page 1 of 1 (20 total questions)
Your team uses a remote S3 backend with DynamoDB locking. A colleague ran `terraform apply` but it failed mid-way. The lock was NOT automatically released. What is the safest first step?
View Question & Answer ➔
You need to remove a specific resource from Terraform state management without destroying the actual cloud resource. Which command accomplishes this?
View Question & Answer ➔
You have a `variable "env"` with no default value. When running `terraform plan` in a CI/CD pipeline (non-interactive), how should you supply the value without prompting?
View Question & Answer ➔
You want to create 3 identical EC2 instances with different names using a single `resource` block. Which Terraform meta-argument is most appropriate?
View Question & Answer ➔
A production RDS instance must never be accidentally deleted via `terraform destroy`. Which lifecycle setting enforces this?
View Question & Answer ➔
You are updating an ECS task definition that requires destroying the old task first. The service must have zero downtime. Which lifecycle setting achieves this?
View Question & Answer ➔
Terraform continuously detects drift on an S3 bucket's `tags` attribute set by an external process, causing noisy plans. How do you suppress this without removing the attribute?
View Question & Answer ➔
Two engineers on your team each run `terraform apply` simultaneously against the same remote state. What protects state from corruption?
View Question & Answer ➔
Your CI pipeline runs `terraform plan` on every pull request and posts the output as a comment. A `terraform plan` exits with code 2. What does this mean?
View Question & Answer ➔
A new team member ran `terraform apply` in the dev environment and accidentally modified the shared VPC used by all environments. Which practice would have prevented this?
View Question & Answer ➔
You want to enforce that all Terraform changes go through a code review and plan approval before `apply`. Which tool natively supports this workflow?
View Question & Answer ➔
You are designing Terraform code for a large organization with 50+ microservices sharing common networking, IAM, and security resources. What architectural pattern minimizes blast radius and maximizes reuse?
View Question & Answer ➔
A security audit reveals that database passwords managed by Terraform are stored in plaintext in the state file. What is the recommended remediation?
View Question & Answer ➔
Your Terraform code needs to read a secret from AWS Secrets Manager at runtime. Which approach is correct?
View Question & Answer ➔
What does the `sensitive = true` attribute on a Terraform variable or output actually do?
View Question & Answer ➔
Which Terraform feature allows you to enforce organizational security policies (e.g., "all S3 buckets must have encryption enabled") across all runs automatically?
View Question & Answer ➔
You need to dynamically generate a list of security group ingress rules from a variable. Which HCL construct is correct?
View Question & Answer ➔
In HCL, what is the result of this expression: `[for s in ["a", "b", "c"] : upper(s)]`?
View Question & Answer ➔
What does the `templatefile()` function in Terraform do?
View Question & Answer ➔
You want to output the private IPs of all EC2 instances created with `for_each`. Which HCL expression produces a map of `instance_name => private_ip`?
View Question & Answer ➔
Page 1 of 1