Terraform Tutorials: Variables – Data Type – Boolean
The last of the available variable types is boolean. They give the option to employ simple true or false values. For example, you might wish to have a variable that…
Read more »Terraform Tutorials: Variables – Data Type – Map
In this example, the instance_tags variable is defined with a type of map(string), and it is given a default value of { Name = “my-instance” }. The AWS provider is…
Read more »Terraform variable using TF_VAR environment variables example
How to set Terraform Variables in Windows? Terraform will read environment variables in the form of TF_VAR_name to find the value for a variable. For example, the TF_VAR_region variable can…
Read more »Terraform Tutorials: Variables – Data Type – String
In this example, the instance_name variable is defined with a type of string, and it is given a default value of “my-instance”. The AWS provider is then configured to use…
Read more »Terraform state explained!!!
By – christophchamp Terraform keeps the remote state of the infrastructure It stores it in a file called terraform.tfstate There is also a backup of the previous state in terraform.tfstate.backup When you execute terraform apply, a new terraform.tfstate and…
Read more »Terraform Project – Assignment – Exercise – Lab#2: Modules
How to submit Assignment? Please submit assignment @https://www.debug.school/ and POST url share in the comments of this post. Project 1 – Create a terraform Module in which you create a…
Read more »Terraform Project – Assignment – Exercise – Lab#3: Mixed
How to submit Assignment? Please submit assignment @https://www.debug.school/ and POST url share in the comments of this post. Exercise 1 – Write a terraform configuration file to create a EC2-Instance(RHEL7.5)…
Read more »Terraform workspace explained!!!
What is Terraform workspace? Have you worked with terraform workflow? such as terraform init/plan/apply/destroy with terraform configuration file? If Yes, you already have worked with Terraform workspace. YES. Thats a…
Read more »Terraform Advance Workflow loop explained!!!
validate – Validates the Terraform files init – Init. Initialize the (local) Terraform environment. Usually executed only once per session. providers – Prints a tree of the providers used in…
Read more »Decide factor to write Terraform Module or not?
Terraform modules are reusable configuration units. They let you manage pieces of infrastructure as a single package you can call and define multiple times in the main configuration for a…
Read more »Terraform Environment Variables Exaplained!
Terraform has many environment variables which can be used to customize various aspects of its behavior of terraform. However all are optional, i.e None of these environment variables are required….
Read more »Terraform Tutorials: Variables – Data Type – List
In this example, the security_groups variable is defined with a type of list(string), and it is given a default value of [“default”]. The AWS provider is then configured to use…
Read more »Terraform Tutorials: Variables – Data Type – Number
In this example, the instance_count variable is defined with a type of number, and it is given a default value of 1. The AWS provider is then configured to use…
Read more »Terraform: run code after resources is created using using remote-exec provisioners
The chef, file, local-exec, puppet, remote-exec, provisioner invokes a script on a remote resource only after it is created. Thus, if you add provisioner code after “terraform apply”, it would…
Read more »Terraform Error: Invalid reference
Solution: Declare variable with var. such as name = “${var.reponame}” instead of name = “${reponame}”
Read more »Terraform Error: Invalid variable name
Solution You must not use following variables. These names are reserved for meta-arguments in module configuration blocks, and cannot be declared as variable names. source version providers count for_each lifecycle depends_on locals
Read more »Terraform Error: Failed to read ssh private key: no key found
Solutions private_key – The contents of an SSH key to use for the connection. These can be loaded from a file on disk using the file function. This takes preference…
Read more »Terraform Tutorials: How to do Loop / Iterate in Terraform?
Resources Resources are the most important element in the Terraform language. Each resource block describes one or more infrastructure objects, such as virtual networks, compute instances, or higher-level components such…
Read more »Understanding local-exec provisioner in terraform
Terraform Provisioners can be used to do specific actions on the local machine or on a remote machine in order to prepare servers or other infrastructure resources. Provisioners can be…
Read more »Using http and https proxy in terraform
For Windows environment , set the proxy property like below in dos prompt or permanently in windows environment variable. Then run terraform script, it should work. For Linux/Mac environment ,…
Read more »Terraform Web References & Cheatsheet
How to Build Reusable, Composable, Battle tested Terraform Modules Video Slide Comprehensive Terraform Training by Yevgeniy Brikman Tutorials Slides
Read more »Terraform Interview Questions and Answer – Set 1
External data sources must return information in what format? A. XML B. HTML C. JSON D. YAML Ans: C. JSON Which of the following is an example of Source Control…
Read more »How to destroy one specific resource from TF file in Terraform?
Terraform destroy is a command that allows you to destroy either a full stack (based on your TF files), or single resources, using the -target option. You can even do:…
Read more »