- HX Club
- December 8, 2021
Terraform is an infrastructure as a code platform(IaaC) developed by HashiCorp. We can simply write code in the human-readable format following HashiCorp Configuration Language (HCL) and deploy it to get the infrastructure in the cloud. Terraform is supported in many cloud providers like Google, Amazon, Alibaba, etc.
- First, Configure azure cli on you system so click on link https://www.hackerxone.com/blog/install-and-configure-azure-cli-ubuntu
- Download the latest version of Terrafrom.
- Unzip the download file.
sudo apt install zip -y
sudo unzip terraform_0.14.3_linux_amd64.zip
- move terraform to /usr/local/bin/ to execute the command.
sudo mv terraform /usr/local/bin/
- Check the version.
- Once Terraform is installed,then create a folder.
- Go to project directory and create files:-
vim main.tf (creates all the resources)
vim variables.tf ( define the variables type and optionally set a default value)
vim outputs.tf (store the results of a module operation)
- Initializing terraform will make the necessary configuration. So, execute the following command.
- Deploy the code.
- Destroy the above infrastructure.