Day 61- Terraform🔥
Task 1:
find purpose of basic Terraform commands which you'll use often
terraform init
terraform init -upgrade
terraform plan
terraform apply
terraform validate
terraform fmt
terraform destroy
This article provides a concise overview of essential Terraform commands frequently used in infrastructure management. It covers initialization with `terraform init`, upgrading with `terraform init -upgrade`, planning with `terraform plan`, applying configurations with `terraform apply`, validating with `terraform validate`, formatting with `terraform fmt`, and destroying resources with `terraform destroy`. Each command's purpose and usage are clearly explained.
Terraform init {
terraform init
}: This command will scan your.tf
files in the folder and install all the required automation things.Terraform init -upgrade {
terraform init -upgrade
}: Performs the same function asterraform init
but with the additional function of checking for and downloading the latest available versions of the plugins/modules.Terraform plan {
terraform plan
}: This command will create an execution plan for terraforming, the things that will be installed, the name, and the properties added.Terraform apply {
terraform apply
}: The actual command and automation happen in this command.Terraform validate {
terraform validate
}: Validates the configuration files for syntax errors, typos, and other issues without executing any changes. It helps ensure that the configuration is correctly written and structured.Terraform fmt {
terraform fmt
}: Formats the Terraform configuration files according to a standard style guide. It rewrites the files in a canonical format, ensuring consistent styling, indentation, and readability.Terraform destroy {
terraform destroy
}: Initiates the process of destroying all the resources defined in the Terraform configuration. It tears down the infrastructure created by Terraform, prompting for confirmation before actually removing the resources.