Exact question counts, passing scores, and allowed reference materials vary by testing window and state/agency. Always confirm current rules with the official testing provider.
Sample questions
A platform engineering team stores Terraform state in a shared Amazon S3 bucket without state locking configured. Two CI/CD pipelines simultaneously execute terraform apply against the same workspace after merging separate pull requests. What is the primary operational risk, and how should the team prevent it?
Terraform merges concurrent state diffs via S3 Object Versioning, so only S3 PUT costs rise.
The second pipeline fails with a syntax error; adding terraform init -reconfigure prevents this.
Concurrent writes can corrupt state or leave orphaned resources; enable remote state locking (S3 native/DynamoDB or HCP Terraform).
Concurrent applies safely serialize at the AWS API layer through IAM throttling, so enabling S3 Transfer Acceleration is the only required change.
Show the answer
C. Concurrent writes can corrupt state or leave orphaned resources; enable remote state locking (S3 native/DynamoDB or HCP Terraform).
Without remote state locking, two concurrent terraform apply runs read the same starting state and race to overwrite the remote state file, causing lost updates, corrupted state, or untracked/duplicated cloud resources. Enabling state locking—via an S3 backend with native S3 lockfiles (use_lockfile = true) or a DynamoDB lock table, or via HCP Terraform's managed remote execution and locking—ensures only one state-mutating operation runs at a time.
An engineering team manages an AWS Auto Scaling Group (ASG), a Launch Template attached to it, and a stateful production RDS cluster in Terraform. They must ensure: (1) replacing the Launch Template never leaves the ASG without a valid template, (2) accidental terraform destroy cannot delete the RDS cluster, and (3) Terraform ignores ASG desired_capacity changes made dynamically by scaling policies. Which lifecycle settings satisfy all three requirements?
prevent_destroy = true on the template, ignore_changes = all on RDS, and create_before_destroy on ASG.
create_before_destroy = true on the template, prevent_destroy = true on RDS, and ignore_changes = [desired_capacity] on the ASG.
replace_triggered_by on the Launch Template, read_only = true on the RDS cluster, and skip_refresh = true on the ASG desired capacity.
create_before_destroy = false on the template, protect_state = true on RDS, and ignore_changes = [launch_template].
Show the answer
B. create_before_destroy = true on the template, prevent_destroy = true on RDS, and ignore_changes = [desired_capacity] on the ASG.
Terraform's default replacement order is destroy-then-create; setting `create_before_destroy = true` on the Launch Template (or ACM cert / target group) provisions the replacement before removing the old dependency. Setting `prevent_destroy = true` on the stateful RDS cluster causes Terraform to reject any plan that would destroy it. Setting `ignore_changes = [desired_capacity]` on the ASG prevents Terraform from reverting runtime scaling adjustments made by AWS Auto Scaling.
Reference: HashiCorp Terraform Documentation (The `lifecycle` Meta-Argument)
A developer defines variable "db_password" { type = string; sensitive = true } and passes it to an aws_db_instance resource, assuming this prevents the database password from ever being stored in plaintext. What is the actual security behavior of sensitive = true in Terraform?
It only redacts values in CLI/log output; the password is still stored in plaintext in terraform.tfstate unless write-only/ephemeral patterns are used.
It automatically encrypts the variable value inside terraform.tfstate using AES-256-GCM before writing to local disk or S3.
It strips the attribute completely from terraform.tfstate and queries the cloud provider API on every terraform plan to compare hashes.
It prevents the secret from being sent to the provider plugin over gRPC and automatically rotates the credential inside AWS Secrets Manager.
Show the answer
A. It only redacts values in CLI/log output; the password is still stored in plaintext in terraform.tfstate unless write-only/ephemeral patterns are used.
Marking a variable or output `sensitive = true` instructs Terraform to suppress displaying the value in CLI plan/apply output and UI logs, but it does not encrypt or omit the attribute from the state file—managed resource attributes like password are still persisted in plaintext JSON inside terraform.tfstate. Teams must protect state as a sensitive secret (encrypted remote backend with KMS, least-privilege IAM, no VCS commits) and prefer external secrets managers or ephemeral/write-only attributes.
Reference: HashiCorp Terraform Documentation (Sensitive Data in State & Ephemeral Values)
Taking this exam soon?
Tell us which exam domains or calculation drills you want more practice on.