Day 61 - Terraform Commands

Shreya GuptaShreya Gupta
3 min read

Task 1

Find the purpose of basic Terraform commands which you'll use often

  1. terraform init: Initializes a Terraform working directory, downloads providers, and sets up the backend.

  2. terraform init -upgrade: It is used to upgrade the installed provider plugins to their latest available versions. It is typically used when you want to update the provider plugins to take advantage of new features, bug fixes, or security patches.

  3. terraform plan: Generates an execution plan by comparing the desired state defined in the configuration with the current state recorded in the state file. It shows what actions Terraform will take to reach the desired state without actually making any changes.

  4. terraform apply: Applies the changes necessary to reach the desired state by creating, modifying, or destroying resources. It executes the actions outlined in the plan and updates the state file accordingly.

  5. terraform validate: Checks the syntax and validity of the Terraform configuration files without actually executing any operations. It validates the configuration for correctness and reports any errors or warnings.

  6. terraform fmt: It is used to automatically format your Terraform configuration files in a consistent and standardized manner. It helps enforce a consistent code style and makes your configuration files more readable.

  7. terraform destroy: It is used to destroy all the infrastructure resources managed by Terraform. It effectively tears down the infrastructure provisioned by previous terraform apply commands.

Who are Terraform's main competitors?

  1. Ansible - While Ansible is primarily known as a configuration management tool, it also has infrastructure provisioning capabilities. Ansible allows you to define and manage infrastructure resources using YAML-based playbooks. It provides a broader set of capabilities beyond just infrastructure provisioning.

  2. Puppet - Puppet is another configuration management tool that offers some infrastructure provisioning capabilities. It allows you to define and manage infrastructure resources using its domain-specific language (DSL) or Ruby-based code. Puppet is more focused on configuration management but can also handle infrastructure provisioning tasks.

  3. Chef - Chef is a configuration management tool that offers infrastructure provisioning capabilities through its "Chef Infra" component. It uses a Ruby-based DSL to define and manage infrastructure resources across multiple platforms.

  4. AWS CloudFormation - AWS CloudFormation is a service provided by Amazon Web Services (AWS) that allows you to define and provision AWS infrastructure resources using JSON or YAML templates. It is tightly integrated with AWS services and provides a declarative approach to infrastructure provisioning.

  5. Azure Resource Manager (ARM) Templates - Azure Resource Manager is Microsoft Azure's native infrastructure provisioning and management tool. ARM templates enable you to define and deploy Azure resources using JSON templates. They provide similar functionality to Terraform but are specific to the Azure ecosystem.

  6. Google Cloud Deployment Manager - Google Cloud Deployment Manager is Google Cloud Platform's infrastructure provisioning tool. It allows you to define and deploy Google Cloud resources using YAML or Python templates. It provides a declarative approach to infrastructure provisioning in the Google Cloud environment.

  7. Packer - Packer is an open-source tool that creates identical machine images for multiple platforms from a single source configuration. It is mainly focused on building and deploying machine images, while Terraform is focused on creating and managing infrastructure.

  8. Cloud Foundry - Packer is an open-source tool that creates identical machine images for multiple platforms from a single source configuration. It is mainly focused on building and deploying machine images, while Terraform is focused on creating and managing infrastructure.

  9. Kubernetes - Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. It provides a higher level of abstraction than Terraform and is mainly focused on container orchestration rather than infrastructure management.

Thank you for reading!!
~Shreya Gupta

Great initiative by the #trainwithshubham community. Thank you Shubham Londhe

#devops #90daysofdevops #terraform #terraformcommands

0
Subscribe to my newsletter

Read articles from Shreya Gupta directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shreya Gupta
Shreya Gupta

I am a software engineer having working experience of 4+ years. I have been a part of web development and have hands-on experience in Laravel, Html, Codeigniter, CSS, PHP, OOPS, Bootstrap, React, Javascript, jQuery and Linux. Currently learning DevOps, AWS & more skills.