Day 61- Terraform🔥

Task 1:

find purpose of basic Terraform commands which you'll use often

  1. terraform init

  2. terraform init -upgrade

  3. terraform plan

  4. terraform apply

  5. terraform validate

  6. terraform fmt

  7. 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.

  1. Terraform init {terraform init }: This command will scan your .tf files in the folder and install all the required automation things.

  2. Terraform init -upgrade {terraform init -upgrade}: Performs the same function as terraform init but with the additional function of checking for and downloading the latest available versions of the plugins/modules.

  3. 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.

  4. Terraform apply {terraform apply}: The actual command and automation happen in this command.

  5. 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.

  6. 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.

  7. 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.