4

Using Terraform with External Data

When using a Terraform configuration, sometimes we might be required to get information about existing resources or infrastructures that were not provisioned by Terraform. Moreover, we may need to interact with the local system by manipulating local files or even running programs that are installed on the local system.

In this chapter, we will learn how to retrieve data from external systems by using data sources and querying external resources. We will cover the use of Terraform for local operations, such as running a local executable and manipulating local files. Finally, we will learn how to use the Terraform Shell provider to execute shell scripts.

In the past, I have seen some people trying to build ...

Get Terraform Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.