Remote Provisioners

Learn how to run commands on Terraform resources after they’ve been created.

Working with remote provisioners

Remote or remote-exec provisioners are used to run remotely on a target resource. Remote provisioners enable us to configure a remote resource flexibly. Let’s consider three scenarios where remote-exec provisioners shine:

Imagine a situation where we’re provisioning an EC2 instance that’s intended for use as a web server, and we need to install some packages alongside it. We can set up the node by following the steps below:

  1. Add the block below to configure the VPC, internet gateway, routing, and subnet to use.

Get hands-on with 1400+ tech skills courses.