Skip to main content

Tools you need before you start using Terraform for orchestration infrastructure in cloud

Terraform one of the famous open source tool used for planning, deploying and maintaining infrastructure as a code and the beauty of this tool is that it works across various cloud service providers.

Even though I personally like the AWS Cloudformation, it is AWS only and most probably it will always remain limited to Amazon Web Services. It has few advantages over other tools when using with AWS and will be the first to have new AWS features incorporated before other tools and APIs catch up.

However if you are not limiting yourself to AWS only or have hybrid environment you may want to use a 3rd party tool compatible for all cloud infrastructures. Terraform being one of them is youngest client only tool and this article will help you setting up your desktop environment and give you understanding of how it works before you can start to code.


Computer running Windows, Linux, Solaris or MacOS operating system.

Download Terraform directly from the creator HashiCorpp 
Download open source code editor - Visual Studio Code from Microsoft

You could also adopt the Chocolatey to install packages using Linux like commands. 

Setting up Windows desktop:

Using Chocolatey you can run following command to install Terraform and it will set environment variables for you automatically.

c:\choco install terraform

Alternatively you download Terraform executable and place it in a folder such as C:\Terraform\Terraform.exe. Essentially the executable is all you need but you'll have to manually set up environment variable to execute it from anywhere in console by adding path to environment variable %path%. In order to add path you'll have to go to Control Panel to System and Security > System > Advanced System Settings > Environment Variables. You then open path for user only or system variables and add path to Terraform.exe to the list.

Code editing can be performed by any editor such as Notepad, Notepad++ or for better editor you could choose to install downloaded code editor from Microsoft called Visual Studio Code.

You then need to write a Terraform format file and using the executable you can plan, apply or destroy your infrastructure defined within your terraform file with .tf extension and variables in file named terraform.tfvars available within same folder.

So your project will look like below;

You need to go to Command Prompt or use terminal within Visual Studio Code which uses powershell and change your working directory to ProjectName.

cd c:\users\username\documents\projectname

Once you are in your working folder and have your first project with variables, providers and resources defined you need to get the provider api or executables downloaded which can be done simply by typing following command.

terraform.exe init

You can also check list of providers by using the command bellow.

terraform.exe providers

With your sample project ready you can see what the implementation will look like by using command below. This will tell you what terraform will do including number of resources to be added, changed or destroyed.

terraform.exe plan

If you are happy with the plan you can run the plan by executing command below.

terraform.exe apply

Changes to the original plan can be implemented by executing above command again after modifying your main project .tf file. However please ensure that you do not make any changes to other system generated files.

Please pay attention to the full output.

Once you have finished with your project you can destroy everything that was created using this project by executing below.

terraform.exe destroy

The sample project to create a single web server is available in this blog.

Popular posts from this blog

TrueCrypt on macOS X Mojave 10.14

If you have updated your macOS recently to Mojave otherwise known as verison 10.14 you may not be able to install the last version of Truecrypt in order to access your old volumes encrypted with Truecrypt software. This article will guide you to get this working on your MacOS v10.14 (Mjoave).

Download the package from or
Find downloaded package using Finder in your HDD/Users/username/Downloads folder and will look like TrueCrypt 7.1a Mac OS X.dmg.

Open file location in Finder and open or double click on TrueCrypt 7.1a Mac OS X.dmg. This will mount Truecrypt 7.1a and will have Truecrypt 7.1a.mpkg in it.

Drag the package TrueCrypt 7.1a.mpkg and drop in your Downloads folder.

From Locations in Finder you can eject your TrueCrypt mount.

Now go to your Downloads location, find the file TrueCrypt 7.1a.mpkg, right click and select Show Package Contents. Find the file Contents/distribution.dist and open with your favourite edi…

Starting with Python

New to Python, don't feel behind and get started now, it is never too late.
Here we have some useful links you will need to get you going.

CoVid-19 Statistics and Charts

Statistics based on some specific metrics are listed below. The data is based on daily information from Worldometer and updated manually. Charts will update automatically.

Please use links below to get to individual charts and feel free to bookmark this page but do not bookmark direct chart link as it may change. These charts compare statistics for countries including China, Italy, UK, US, Pakistan & India.
(Does not work in Safari Mobile)

Please click on links below for specific chart, more to come.

Death Doubling RateChart showing death rate doubling in x number of days.

Survival RateThis chart shows trend of patients successfully recovered vs total closed cases.
Death rate comparisonComparison of deaths per cases every day showing trend comparison and days behind.
Cases reportedNo of cases reported, how far they are behind each other and trend. Deaths reported No of deaths reported with trend comparison between three countries.

The data for these charts is extracted directly from John Ho…