DevOps(Day-61): Terraform Commands

DevOps(Day-61): Terraform Commands

TABLE OF CONTENTS

Hope we've already got the gist of What Working with Terraform would be like. Let's begin with day 2 of Terraform!

Task 1: Commonly used Terraform commands

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

  1. terraform init - Initializes a new or existing Terraform configuration in the current directory. This command downloads and installs any necessary plugins or modules needed to execute the configuration

  2. terraform init -upgrade - Upgrades the installed Terraform plugins to the latest version, if available. This command is useful when upgrading Terraform versions or when there are new versions of the plugins that need to be used.

  3. terraform plan - Shows an execution plan of the changes that Terraform will make to infrastructure, without actually making those changes. This command helps to identify potential issues before applying infrastructure changes.

  4. terraform apply - Applies the changes to the infrastructure defined in the Terraform configuration. This command creates, modifies, or deletes resources as necessary to bring the infrastructure into the desired state.

  5. terraform validate - Checks the Terraform configuration files for syntax errors and other potential issues. This command helps to identify any problems in the configuration before attempting to apply changes to the infrastructure.

  6. terraform fmt - Formats the Terraform configuration files to follow the standard formatting conventions. This command ensures consistency in the codebase and makes it easier to read and maintain.

  7. terraform destroy - Destroys all the infrastructure resources that were created by the Terraform configuration. This command is useful when tearing down an entire environment or cleaning up resources that are no longer needed.

Who are Terraform's main competitors?

The main competitors are:

  1. Ansible - Ansible is an open-source tool that automates software provisioning, configuration management, and application deployment. It has some infrastructure automation features, but it is mainly focused on application deployment and configuration management.

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

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

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

  5. Chef - Chef is an open-source configuration management tool that automates the deployment and management of infrastructure. It uses a declarative language called "cookbooks" to define the desired state of the infrastructure.

  6. Puppet - Puppet is another open-source configuration management tool that automates the deployment and management of infrastructure. It uses a declarative language called "manifests" to define the desired state of the infrastructure.

  7. AWS CloudFormation - AWS CloudFormation is a service provided by Amazon Web Services that allows users to define and deploy infrastructure resources in a repeatable and automated fashion. It uses JSON or YAML templates to define the desired state of the infrastructure.

  8. Google Cloud Deployment Manager - Google Cloud Deployment Manager is a service provided by Google Cloud Platform that allows users to define and deploy infrastructure resources using YAML or Python templates. It provides similar functionality to AWS CloudFormation.

While these tools have some overlapping capabilities with Terraform, each one has its unique strengths and use cases. Ultimately, the choice of tool will depend on the specific needs of the organization and the type of infrastructure being managed.

Thanks for reading my article. Have a nice day

WRITTEN BY Biswaraj Sahoo --AWS Community Builder | DevOps Engineer | Docker | Linux | Jenkins | AWS | Git | Terraform | Docker | kubernetes

Empowering communities via open source and education. Connect with me over linktree: linktr.ee/biswaraj333