Terraform Commands

Terraform Commands

#90 Days of DevOps Challenge - Day 61

Basic Terraform commands

  1. terraform init ->The terraform init command is used to initialize a Terraform working directory. When you start working with a new Terraform configuration or switch to a different directory containing Terraform files, it's essential to run terraform init first.

  2. terraform init -upgrade -> The terraform init -upgrade command is used to initialize a Terraform working directory and also upgrade the installed provider plugins to their latest available versions. This command performs the same tasks as terraform init, but additionally checks for and installs any newer versions of the provider plugins specified in your Terraform configuration.

  3. terraform plan -> The terraform plan command is used to create an execution plan in Terraform. It examines your Terraform configuration files and state to determine what changes would be made to your infrastructure if you were to apply those changes.

  4. terraform apply -> The terraform apply command is used to apply changes to your infrastructure based on the desired state defined in your Terraform configuration files. It takes the execution plan generated by terraform plan and carries out the actions necessary to create, modify, or delete resources.

  5. terraform validate -> The terraform validate command is used to validate the syntax and configuration of your Terraform files without executing any actions. It helps to ensure that your Terraform configuration is correctly written and follows the expected format.

  6. terraform fmt -> The terraform fmt command is used to automatically format your Terraform configuration files. It helps ensure consistent and standardized formatting across your codebase by applying a predefined style.

  7. terraform destroy -> The terraform destroy command is used to destroy the infrastructure resources that were provisioned using Terraform. It reverses the changes made to your infrastructure and removes all resources defined in your Terraform configuration.

  8. terraform refresh -> The terraform refresh command is used to reconcile the Terraform state with the real-world resources managed by Terraform. It retrieves the latest state of the resources from the provider and updates the Terraform state file accordingly.

Terraform's main competitors

Terraform is a popular infrastructure as code (IaC) tool that is widely used in the industry. While there are several other IaC tools available, some of the main competitors to Terraform include:

  1. AWS CloudFormation:- AWS CloudFormation is a service provided by Amazon Web Services (AWS) that allows you to define and provision infrastructure resources using JSON or YAML templates. It is tightly integrated with the AWS ecosystem and provides native support for managing AWS resources.

  2. Azure Resource Manager (ARM) Templates:- Azure Resource Manager is the deployment and management service provided by Microsoft Azure. ARM Templates are JSON files that define the desired state of Azure resources and can be used to provision and manage infrastructure on the Azure platform.

  3. Google Cloud Deployment Manager:-Google Cloud Deployment Manager is a service offered by Google Cloud Platform (GCP) that allows you to define and deploy resources using YAML or Python templates. It provides infrastructure provisioning and management capabilities for GCP resources.

  4. Ansible:-Ansible is an open-source automation platform that enables you to automate infrastructure provisioning, configuration management, and application deployments. While Ansible is primarily known for its configuration management capabilities, it also supports infrastructure provisioning, similar to Terraform.

  5. Puppet:- Puppet is a configuration management tool that provides automation and orchestration capabilities for infrastructure management. It focuses on maintaining the desired state of infrastructure resources and ensuring consistency across environments.

  6. Chef:- Chef is another popular configuration management tool that provides infrastructure automation and management capabilities. It allows you to define and enforce infrastructure configurations and manage resources across different platforms.

Devops#devops,#90daysofDevOps

Thank you for reading!! I hope you find this article helpful!!

if any queries or corrections to be done to this blog please let me know.

Happy Learning!!

Saikat Mukherjee

Printable, customizable thank you card templates | Canva

Did you find this article valuable?

Support Saikat Mukherjee by becoming a sponsor. Any amount is appreciated!