local-exec provisioner

Last updated

What is local-exec provisioner?

The local-exec provisioner in Terraform allows the execution of local commands on the machine running Terraform after a resource is created. It's useful for tasks that need to be performed locally rather than on the remote resource. This provisioner can run scripts, update local files, or trigger local processes based on the creation of cloud resources. Common use cases include updating local inventories, triggering local notifications, or running local scripts that interact with the newly created resources. While powerful, it should be used judiciously as it can make Terraform operations dependent on the local environment. The local-exec provisioner doesn't affect the resource itself and isn't tracked in Terraform's state, so it's important to design these commands to be idempotent. It's best suited for simple, local operations that don't require complex error handling or state management.

Free resources to learn local-exec provisioner

More in stage 15: Provisioners

local-exec provisioner: common questions

Can I learn local-exec provisioner in Hindi?

This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain local-exec provisioner in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.

Is this local-exec provisioner tutorial for beginners?

It is lesson 63 of 110 in the free Terraform roadmap, in stage 15, Provisioners. If you are new to Terraform, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.

Still confused? Ask me