This has been cross posted from my own blog vGemba.net. Go check it out!
In Part 1 of this series we went about installing Terraform, verifying it was working and setting up Visual Studio Code. In this part we will cover some Terraform basics.
The three Terraform Constructs we are going to look at are:
Providers are the resources or infrastructure we can interact with in Terraform. These can include AWS, Azure, vSphere, DNS, etc. A full list is available on the Terraform website. As you can see it’s a very big list. In this series we will concentrate on the VMware vSphere Provider.
Resources are the things we are going to use in the provider. In the vSphere realm this can be a Virtual Machine, Networking, Storage, etc.
Terraform uses Provisioners to talk to the back end infrastructure or services like vSphere to create your Resources. They essentially are used to execute scripts to create or destroy resources.
Setup Terraform for vSphere
Open up Visual Studio Code and create a new file called
main.tfin the folder
C:\Terraform. If you have added
C:\Terraform to your Path environment variable save
main.tf anywhere you like, but of course the best place for all of your Terrform files is source control…