Home / Companies / Spacelift / Blog / Post Details
Content Deep Dive

Terraform Provisioners : Why You Should Avoid Them

Blog post from Spacelift

Post Details
Company
Date Published
Author
Sumeet Ninawe
Word Count
3,545
Language
English
Hacker News Points
-
Summary

Terraform is a powerful IaC tool that helps build infrastructure using code and can perform tasks when an EC2 instance boots or is destroyed through provisioners. However, Hashicorp suggests the usage of Terraform provisioners should only be considered in cases where there are no other options available. The local-exec provisioner executes shell commands on the host system, while the file provisioner copies files from the host machine to target resources. The remote-exec provisioner runs commands on the target EC2 instance instead of the Terraform host. These provisioners should be used as a last resort due to their limitations and potential security risks. Instead, rely on configuration management software like Chef, Puppet, Ansible, etc., for such tasks.