Table of contents
Basic Terraform commands
terraform init
->Theterraform 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 runterraform init
first.terraform init -upgrade
-> Theterraform 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 asterraform init
, but additionally checks for and installs any newer versions of the provider plugins specified in your Terraform configuration.terraform plan
-> Theterraform 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.terraform apply
-> Theterraform 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 byterraform plan
and carries out the actions necessary to create, modify, or delete resources.terraform validate
-> Theterraform 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.terraform fmt
-> Theterraform 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.terraform destroy
-> Theterraform 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.terraform refresh
-> Theterraform 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:
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.
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.
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.
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.
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.
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.
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