Terraform: Create infrastructure on Azure
Project URL: https://www.coursera.org/account/accomplishments/verify/SQU4B3EEBLTT
This project is about an in introdution to Terraform, here is a breaking down to the infrastructure as code:
What is IAC:
Iac refers to infrastructure as code, it is a code that is used to deploy infrastructure instead of deploying them manually throw the user interface.Why terraform:
There are multiple Iac solutions as (Ansible, CloudFormation in AWS, Puppet, ARM in Azure, GCDM in GCP), the reason why terraform is more popular than the other solutions is:- Versatile : Support various private and public cloud providers
- Simple to use: Easy to read code
- Reliable: Keeps track of the infrastructure
- Efficient and Safe : Can do and undo changes ( the same thing as GIT)
What is HCL:
It is the domain specific language build by harshicorp ( the organism that has build terraform). For the record, the extension of the configuration files is ` tf `.What are terraform execution flow:
The terraform execution flow has 3 steps:- Terraform Init --------> Terraform Plan --------> Terraform apply
- To undo infrastructure : Terraform Destroy
- Manage the state file : Terraform State
- Shows output values from the configuration: Terraform output
How variables are used in terraform:
Just like any programming language, Terraform support variables. Declaring variable:variable "filename"{ default="root/files.txt" }
- filename: variable name, default value : root/files.txt
resource "local-file"{ filename=var.filename content= var.content }Variable type:
- String, number, bool, any, list, map( [val1 = "v1", val2="v2"], object