Forrest logo
tool overview
On this page you find all important commands for the CLI tool terraform. If the command you are looking for is missing please ask our AI.

terraform

Terraform is an open-source command line tool that facilitates infrastructure as code. It is developed by HashiCorp and written in Go programming language. The tool allows users to define and provision infrastructure resources in a declarative language, using configuration files known as Terraform scripts. With Terraform, users can manage their infrastructure across various cloud providers, such as AWS, Azure, and Google Cloud, as well as other on-premises or third-party providers. One of the key concepts in Terraform is the infrastructure as code approach, which enables the use of version control systems to manage infrastructure changes and maintain consistency across environments. Terraform utilizes a dependency graph to understand the relationships and interdependencies between resources, enabling efficient creation, modification, and destruction of infrastructure elements. The tool supports various resource types, including virtual machines, networks, storage solutions, databases, and more, allowing users to provision complex infrastructure setups. Terraform also supports modules, which are reusable configurations that can be composed or shared across different projects, promoting code reuse and reducing duplication. Terraform CLI provides features like plan and apply, allowing users to preview changes and then create or update the infrastructure accordingly. The state file in Terraform keeps track of deployed resources, enabling subsequent executions to identify and manage the existing infrastructure. Terraform offers a rich ecosystem with plugins, extensions, and community modules, providing additional functionality and integration with various third-party tools, such as monitoring, security, and automated testing solutions. In summary, Terraform is a powerful command line tool that revolutionizes infrastructure management by enabling infrastructure as code, version control, and seamless provisioning of resources across multiple cloud and on-premises environments.

List of commands for terraform:

  • terraform-fmt:tldr:5caa4 terraform-fmt: Display diffs of formatting changes.
    $ terraform fmt -diff
    try on your machine
    explain this command
  • terraform-fmt:tldr:71a93 terraform-fmt: Format the configuration in the current directory.
    $ terraform fmt
    try on your machine
    explain this command
  • terraform-fmt:tldr:a0975 terraform-fmt: Do not list files that were formatted to `stdout`.
    $ terraform fmt -list=false
    try on your machine
    explain this command
  • terraform-fmt:tldr:d58b5 terraform-fmt: Format the configuration in the current directory and subdirectories.
    $ terraform fmt -recursive
    try on your machine
    explain this command
  • terraform-plan:tldr:2a9a2 terraform-plan: Generate and show the execution plan in the currently directory.
    $ terraform plan
    try on your machine
    explain this command
  • terraform-plan:tldr:31ca3 terraform-plan: Focus Terraform's attention on only a subset of resources.
    $ terraform plan -target ${resource_type-resource_name[instance index]}
    try on your machine
    explain this command
  • terraform-plan:tldr:481b3 terraform-plan: Show a plan to update the Terraform state and output values.
    $ terraform plan -refresh-only
    try on your machine
    explain this command
  • terraform-plan:tldr:5b4dd terraform-plan: Show a plan to destroy all remote objects that currently exist.
    $ terraform plan -destroy
    try on your machine
    explain this command
  • terraform-plan:tldr:5dd85 terraform-plan: Write a plan to a specific file.
    $ terraform plan -no-color > ${filename}
    try on your machine
    explain this command
  • terraform-plan:tldr:9e30f terraform-plan: Output a plan as JSON.
    $ terraform plan -json
    try on your machine
    explain this command
  • terraform-plan:tldr:c335a terraform-plan: Specify values for input variables.
    $ terraform plan -var '${name1}=${value1}' -var '${name2}=${value2}'
    try on your machine
    explain this command
  • terraform:tldr:0750d terraform: Destroy Terraform-managed infrastructure.
    $ terraform destroy
    try on your machine
    explain this command
  • terraform:tldr:624f0 terraform: Initialize a new or existing Terraform configuration.
    $ terraform init
    try on your machine
    explain this command
  • terraform:tldr:680d9 terraform: Verify that the configuration files are syntactically valid.
    $ terraform validate
    try on your machine
    explain this command
  • terraform:tldr:d3bb4 terraform: Build or change infrastructure.
    $ terraform apply
    try on your machine
    explain this command
tool overview