Introduction
Sometimes you need to run a command on your own computer right after creating a resource in the cloud. The local-exec provisioner lets Terraform run these commands automatically. This helps you automate tasks like configuring software or notifying people.
When you want to run a script on your local machine after creating a cloud resource.
When you need to send a notification email or message after deployment.
When you want to run a local command to update a configuration file after resource creation.
When you want to execute a local shell command to prepare your environment for the new resource.
When you want to automate running tests or checks on your local system after infrastructure changes.