Learn how to use Input Variables in Terraform | Terraform Tutorial For Beginners | Beginner Academy

preview_player
Показать описание
Learn how to use Terraform variables | Different ways to provide terraform variable values? | How to create Terraform state | What is the terraform variable precedence | How to create Terraform state remote backend | Terraform Variable Precedence | Input Variables in Terraform | Terraform variables

If you are a beginner or individual who wants to switch to/learn IT DevOps/cloud/Kubernetes. Then please join.

How to create Azure resources using Terraform
Terraform and Azure cloud for beginners
Terraform with Azure for Beginners | Terraform on Azure for Beginners | Beginners Guide to Terraform with Azure

Terraform with Azure for Beginners | Terraform on Azure for Beginners
Beginners Guide to Terraform with Azure

Basic Intro about terraform resources used in this session.
tfstate,

Terraform must store state about your managed infrastructure and configuration.

This state is used by Terraform to map real world resources to your configuration, keep track of metadata

Prior to any operation, Terraform does a refresh to update the state with the real infrastructure.

Variables
Variables serve as parameters for a Terraform module, so users can customize behaviour without editing the source.

Type constraints are created from a mixture of type keywords and type constructors. The supported type keywords are:
string
number
Bool

The type constructors allow you to specify complex types such as collections:
list
set
map

tfvars

The tfvars file declares them thus giving those variables values.

Terraform loads variables in the following order, with later sources taking precedence over earlier ones:

Environment variables

Any -var and -var-file options on the command line, in the order they are provided. (This includes variables set by a Terraform Cloud workspace.)

remote backend
Each Terraform configuration can specify a backend, which defines where state snapshots are stored.

Terraform is an open-source infrastructure as a code tool. HashiCarp has developed it.

Terraform is used by almost all experts/engineers to create any cloud infrastructure. Terraform is go to tool for all the Cloud Engineers.

Below are the key benefits of terraform

We can codify our application infrastructure
An infrastructure that can be easily reproduced using terraform.
We can version control infrastructure, it can be kept securely and safely.
Why Terraform is so Popular?
Currently terraform is go to tool for any infrastructure provisioning tasks.

Below are the main reasons

Free to use.
Terraform is declarative language.
Learning curve is very short.
Once you learn terraform, it is easy to provision infrastructure in other cloud providers with minimal effort.
Syntax is same for other providers.
We can create Immutable infrastructure.
Once you don’t need infrastructure, we can destroy infrastructure. Which will save the cost for IT resources.
Terraform is master and agent less compared to other tools. Which saves costs.
How to install Terraform on laptop?
In order to install terraform please download appropriate package for your system as zip.

Steps to install on Mac/Linux
Unzip terraform
In order to move the terraform binary use command “mv terraform /usr/local/bin/”
In order to verify installation, run command “terraform -help”
Steps to install on Windows
Go to Control Panel --- System ---- System settings --- Environment Variables.
Scroll down in system variables until you find PATH.
Click edit and change accordingly.
BE SURE to include a semicolon at the end of the previous as that is the delimiter, i.e. c:\path; c:\terraform
Рекомендации по теме