When you run terraform apply with the -auto-approve flag, what happens?
Think about what 'auto' and 'approve' mean together.
The -auto-approve flag skips the manual confirmation step and applies changes right away.
Why can using -auto-approve be dangerous in production environments?
Consider what happens if you skip the manual check step.
Using -auto-approve skips the confirmation, so mistakes or destructive changes can be applied without review.
terraform apply -auto-approve after modifying a resource to be destroyed?Given a Terraform configuration where a resource is changed to be removed, what is the behavior when applying with -auto-approve?
resource "aws_instance" "example" { ami = "ami-123456" instance_type = "t2.micro" } # Later, this resource is removed from the config # Running: terraform apply -auto-approve
Think about what skipping approval means for destructive actions.
The -auto-approve flag causes Terraform to apply all changes, including resource destruction, without confirmation.
To safely use -auto-approve in automation, what should you do?
Think about how to catch mistakes before applying changes.
Running terraform plan first lets you review changes and catch errors before applying with -auto-approve.
You want to automate Terraform deployments in a pipeline but avoid accidental destructive changes. Which approach is safest?
Consider how to balance automation and safety in pipelines.
Running plan and requiring manual approval before auto-approve apply prevents accidental destructive changes in automation.