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?
Think about Terraform's default behavior when applying changes.
By default, terraform apply runs a plan internally, shows it to you, and asks for confirmation before making changes.
You want to apply Terraform changes in an automated script without manual confirmation. Which command should you use?
Look for the official Terraform flag that skips approval.
The -auto-approve flag skips the interactive approval step during terraform apply.
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?
Think about how Terraform handles state backend changes.
Terraform automatically migrates the state to the new backend when backend config changes are detected during terraform init or terraform apply.
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?
Consider what skipping approval means for changes.
Using -auto-approve skips manual review, so destructive or unintended changes can happen without warning.
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?
Think about partial failures and state synchronization.
Timeouts can cause resources to be created but Terraform state not updated, leading to drift and manual reconciliation needs.