Interview Prep/Terraform/Lifecycle, Dependencies, Provisioners and Drift

What does the `connection` block do?

IntermediateConceptLifecycle, Dependencies, Provisioners and Drift
Answer

It tells remote-exec and file provisioners how to reach the machine (SSH or WinRM): host, user, private key, bastion host and timeout. It requires network reachability from wherever Terraform runs, which is one reason we avoid these provisioners in CI.

All Terraform questions Roadmap: Terraform in production

More on Lifecycle, Dependencies, Provisioners and Drift