Terraform with Nutanix Provider

I like to keep things simple because I think simple is easy to understand. In college I had an instructor that always told the class K.I.S.S (keep it simple stupid). Anyway, this weekend I started to play with Terraform and the Nutanix Provider for the first time. My goal was to build a simple main.tf that anyone could understand and use as a template for learning. Below is my main.tf working with Terrafrom 0.11.3 and Nutanix Provider 1.0.0. This main.tf creates a simple CentOS VM and uses cloud-init for user data. This main.tf connects to Nutanix Prism Central rather than Prism Element.

Review Docs https://www.terraform.io/docs/providers/nutanix/index.html

Install Terraform

Create the main.tf and .conf file for cloud-init.  If you don’t want to use cloud-init then comment out guest_customization_cloud_init_user_data.  In the below example mine is called devmin.conf.

Example main.tf

Try it out
In the directory where main.tf exists run the below.  Note: that “terraform init” will download the Nutanix Provider.

About the Author: devmin

systems architect with interest in automation, k8s, linux, devops, bash, real estate, anonymity

1 Comment

  1. I am doing terraform for AWS and GCP for a while, but recently I joined a new company which use Nutanix. This really helped me but I got question here. How can we manage terraform states in Nutanix?.

Leave a Reply

Your email address will not be published. Required fields are marked *