DevOps (Day: 61) Terraform Commands

DevOps (Day: 61) Terraform Commands

Day 61:#90DaysOfDevOpsChallenge

ยท

4 min read

Table of contents

No heading

No headings in the article.

Task-01 Terraform Commands

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

No alt text provided for this image

1 Terraform init:

Initializes a new or existing Terraform working directory by downloading the required provider plugins and sets up the backend to store the state. This command must be run before any other Terraform command is executed.

No alt text provided for this image

Terraform init Diagram.

2 Terraform init-upgrade:

Upgrades the configuration to the latest version of Terraform. This is useful if you have upgraded your Terraform version and want to ensure that your configuration is compatible with the new version.

3 Terraform plan:

No alt text provided for this image

Terraform plan

No alt text provided for this image

Terraform plan Diagram.

Shows the changes that Terraform will make to the infrastructure to bring it into the desired state,without actually making the changes. This is useful to see what changes terraform will make before actually applying them.

4 Terraform apply:

No alt text provided for this image

Terraform apply Diagram

No alt text provided for this image

Terraform apply Diagram

Applies the changes to the infrastructure described in the Terraform configuration files. This command will create,modify,or delete resources as needed to bring the infrastructure into the desired state.

5 Terraform Validates:

Validates the syntax and structure of the Terraform configuration file. This command checks for errors, missing required arguments and other issues.

6 Terraform fmt:

No alt text provided for this image

Terraform fmt Diagram.

Rewrites terraform Configuration files to a canonical format, Which makes it easier to read and manintain.

7 Terraform destroy:

No alt text provided for this image

Terraform Destroy Diagram.

Destroys all the infrastructure created by Terraform, freeing up the resources and ensuring that you are not paying for unused infrastructure. This command should be used with caution as it will delete all the resources described in the configuration file.

What are the main competitors of Terraform?

AWS Cloud Formation:

No alt text provided for this image

AWS Cloud Formation Diagram.

AWS CloudFormationis an IaC tool provided by Amazon web Services (AWS). It allows users to define and manage infrastructure resources in a declarative way using JSON or YAML templates. CloudFormation supports a wide range of AWS services and is tightly integrated with other AWS tools and services.

Ansible:

No alt text provided for this image

Ansible Diagram.

Ansible is an open-source tool that uses YAML scripts to define and manage infrastructure resiurces. Ansible can be used for provisioning, configuration management and application deployments across multiple platforms and cloud providers.

Kubernets:

No alt text provided for this image

Kubernetes Diagram,

Kubernetes is another IT automation alternative to Terraform. It is an open-source solution that enables automated deployment,management,and scaling of containerized application. It simplifies containerized applications. It simplifies container communication. It facilitated container discovery and management with an application.

Puppet:

No alt text provided for this image

Puppet in DevOps Diagram,

Puppet is an another open-source IaC tool that uses a declarative language to define and manage infrastructure resource. Puppet has a large community of users and contributors and supports a wide range of platforms and the cloud providers.

Chef:

No alt text provided for this image

Chef Architecture Diagram.

Chef is an open-source IaC tool that uses Rubyscripts to define and manage infrastructure resources. Chef is particularly well-suited for managing large-scale infrastructure and supports a wide range of platforms and cloud providers.

Packer:

No alt text provided for this image

Packer Diagram.

Packer create identical machine images for the multiple platforms from a single resource configuration. A common use case is creating golden images for organisations to use in cloud infrastructure.

Cloud Foundry:

No alt text provided for this image

Cloud Foundry is an open source cloud application platformthat makes it faster and easier to build test, deploy and scale apps in your choice of cloud,framework and language. Remove the cost and complexity associated with configuring, managing and securing infrastructure for your app with Cloud Foundry.

Thank you for reading!! Hope you find this helpful.

#day61challenge#90daysofdevops

Always open to suggestions..!!

~ Manoj Bhamidipati ๐Ÿ™‚

ย