Table of contents
No headings in the article.
ππΌ Terraform is an open-source Infrastructure as Code (IaC) tool developed by HashiCorp.
ππΌIt allows users to define and provision infrastructure using a declarative configuration language.
ππΌπππ«π ππ«π π¬π¨π¦π π€ππ² πππ«π«πππ¨π«π¦ ππ¨π¦π¦ππ§ππ¬ ππ§π π ππ«π’ππ ππ±π©π₯ππ§πππ’π¨π§ π¨π ππππ‘:
1. πππ«π«πππ¨π«π¦ π’π§π’π:
- Initializes a working directory containing Terraform configuration files. This command downloads the required provider plugins and sets up the backend.
2. πππ«π«πππ¨π«π¦ π©π₯ππ§:
- Generates an execution plan describing what Terraform will do to reach the desired state specified in the configuration files. It shows the changes to be made before actually applying them.
3. πππ«π«πππ¨π«π¦ ππ©π©π₯π²
:
- Applies the changes required to reach the desired state of the configuration. It creates, modifies, or deletes infrastructure resources as needed.
πππ«π«πππ¨π«π¦ πππ¬ππ«π¨π²
:- Destroys the infrastructure defined in the Terraform configuration. It's important to review the plan before confirming the destruction, as this operation is irreversible.
5. πππ«π«πππ¨π«π¦ π―ππ₯π’ππππ
:
- Checks and validates the configuration files for syntax errors and other issues. It ensures that the Terraform files are correctly formatted.
6. πππ«π«πππ¨π«π¦ ππ¦π
:
- Rewrites Terraform configuration files to a canonical format. It helps maintain a consistent style across your configuration files.
7. πππ«π«πππ¨π«π¦ π¬π‘π¨π°
:
-: Outputs the current state or a saved plan. It provides a human-readable representation of the state of your infrastructure.
8. πππ«π«πππ¨π«π¦ π¬ππππ
:
- Performs operations on Terraform state files. This includes listing resources in the state, removing a resource from the state, and more.
9. πππ«π«πππ¨π«π¦ π’π¦π©π¨π«π
:
- Imports existing infrastructure into Terraform. It associates a resource in your Terraform configuration with an existing resource in your infrastructure.
10. πππ«π«πππ¨π«π¦ π°π¨π«π€π¬π©πππ
:
Manages workspaces. Workspaces allow you to manage multiple instances of your infrastructure configurations, such as development and production environments.
πππ«π«πππ¨π«π¦ output
:
Reads an output variable from a Terraform state file. It's used to inspect the values of variables or expressions defined in the configuration.
Terraform is widely used for provisioning and managing infrastructure across various cloud providers and on-premises environments.
#devops #terraform #learning #commands