0
0
Terraformcloud~20 mins

Terraform apply for execution - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Terraform Apply Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
What happens when you run terraform apply without prior terraform plan?

You have a Terraform configuration ready. You run terraform apply directly without running terraform plan first. What will Terraform do?

ATerraform will apply changes immediately without showing any plan or confirmation.
BTerraform will show the execution plan and ask for confirmation before applying changes.
CTerraform will throw an error saying you must run <code>terraform plan</code> first.
DTerraform will only validate the configuration but not apply any changes.
Attempts:
2 left
💡 Hint

Think about Terraform's default behavior when applying changes.

Configuration
intermediate
2:00remaining
Which command applies Terraform changes automatically without interactive approval?

You want to apply Terraform changes in an automated script without manual confirmation. Which command should you use?

Aterraform apply -auto-approve
Bterraform apply -no-confirm
Cterraform plan -auto-approve
Dterraform deploy --force
Attempts:
2 left
💡 Hint

Look for the official Terraform flag that skips approval.

Architecture
advanced
2:30remaining
What is the effect of running terraform apply with a changed backend configuration?

You modify the backend configuration in your Terraform files (e.g., change S3 bucket for state). What happens when you run terraform apply after this change?

ATerraform will ignore the backend change and use the old backend.
BTerraform will delete the old state and start fresh with the new backend.
CTerraform will fail with an error about inconsistent backend configuration.
DTerraform will migrate the state to the new backend before applying changes.
Attempts:
2 left
💡 Hint

Think about how Terraform handles state backend changes.

security
advanced
2:30remaining
Which risk is most relevant when running terraform apply with -auto-approve in a production environment?

You run terraform apply -auto-approve in production. What is the main security or operational risk?

AUnintended destructive changes may be applied without review.
BTerraform will expose sensitive variables in logs automatically.
CThe state file will be encrypted with a weak algorithm.
DTerraform will disable all resource-level access controls.
Attempts:
2 left
💡 Hint

Consider what skipping approval means for changes.

🧠 Conceptual
expert
3:00remaining
What is the state of resources after a failed terraform apply due to provider API timeout?

You run terraform apply and the provider API times out during resource creation. What is the expected state of the resources and Terraform state file?

AAll resources are created and state file is fully updated despite timeout.
BNo resources are created and Terraform state remains unchanged.
CSome resources may be created in the cloud but Terraform state is not updated for them.
DTerraform automatically rolls back all created resources and resets state.
Attempts:
2 left
💡 Hint

Think about partial failures and state synchronization.