Creating a custom VM using Terraform

Terraform is a powerful tool used for defining infrastructure as code on various platforms. Two of the biggest advantages of Terraform are its simple templating language (HashiCorp Configuration Language, also known as HCL) and its state maintenance. Terraform's role of provisioning plays well with other configuration management tools. The configurations given to Terraform are converted into API calls to perform the provisioning. Also, when a change is made to the desired state, for example, the count of instances is updated from two to three, Terraform keeps track of the state and launches the creation of one new instance.

In this recipe, similar to the tailor-made VM we created using the Deployment Manager ...

Get Google Cloud Platform Cookbook 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.