Assignment 4 by Nallagatla Sarvani [26-05-2022]
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
What is Terraform?
Terraform is a tool to write a code & it allows to programmatically provision the physical resources to an application requires to run. It is used to automate the provisioning of your cloud resources. Terraform is an open-source, cloud-agnostic provisioning tool developed by HashiCorp and written in GO language.
Example Terraform program
resources.tf
resource “github_repository” “Sample” {
name = “terraform1”
description = “My first terraform project”
visibility = “public”
}
terraform.tf
provider github
{
token=”ghp_CpzDx9BrikaSXBsOVJ4t90NoK0FZQH3AkrzP”
owner=”Organization”
Terraform commands and its use
- terraform init : used to initialize the directory which consists of configuration files.
- terraform plan : uses to check the configuration to determine the desired state of all the resources it declares.
- terraform apply : used to planned changes to resource using the same type of infrastructure providers API.
- terraform destroy : used to destroy all the resources being managed by current directory.
- terraform show : used to provide an output of plan file in understandable manner.