Why Provisioners Are a Last Resort in Terraform
📖 Scenario: You are managing cloud infrastructure using Terraform. You want to understand how to handle tasks that Terraform does not natively support, like running scripts on a virtual machine after it is created.
🎯 Goal: Build a simple Terraform configuration that creates a virtual machine and uses a provisioner as a last resort to run a script on it.
📋 What You'll Learn
Create a Terraform resource for a virtual machine
Add a connection block to enable communication with the VM
Add a provisioner block to run a script on the VM
Understand why provisioners should be avoided when possible
💡 Why This Matters
🌍 Real World
Provisioners are sometimes needed to perform tasks that Terraform cannot do natively, like installing software or configuring a VM after creation.
💼 Career
Cloud engineers and DevOps professionals often need to understand when and how to use provisioners safely to avoid unstable infrastructure deployments.
Progress0 / 4 steps