Terraform is an infrastructure as code tool which can be used to manage the resources in both cloud and on-prem resources. You can then use a workflow to provision and manage all of your infrastructure throughout its lifecycle. Terraform creates and manages resources on cloud platforms and other services through their application programming interfaces (APIs)
Three stages in Terraform.
- Write
- Define the infrastructure as code.
- Plan
- Review the changes that is going to implement.
- Apply
- Apply the code to build/change the infrastructure.
Get your tool kit ready. What you need to run the Terraform code from your local machine.
- Terraform
- Git
- Azure CLI
- Visual Studio Code
Its important to have your infrastructure-as-code platform in a consistent environment Here we are using Chocoloately to automate the installation.
- Navigate to https://chocolatey.org/install
- Copy the installation script and run it on your local machine Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
- This will install the chocolatey package on your machine.
- Now lets create the required packages from chocolatey
- Navigate to https://community.chocolatey.org/packages
- Search for Terraform and click add button.
- Repeat the same for other tools
- Once all the tools are added click on generate script
- Follow the package creation page, Select Individual for the integration method.
- Copy the script.
- Run the script on your machine to install all the packages.
- It's done, now we have all the tools to run the Terraform codes form your local machine.
No comments:
Post a Comment