terraform command reference

3 min read | by Jordi Prats

The terraform's command line interface tool accepts a variety of subcommands and flags to modify how it will handle it's operations. This reference guide provides a quick overview of the available options.

Plan

  • terraform graph: Using terraform graph we can generate a visual representation of a terraform code or plan
  • terraform validate: terraform validate can help us to validate terraform code we are writing
  • terraform: plan in json format: Writing terraform modules it is usefull to be able to conditionally include a resource

Init

  • terraform init -upgrade: Using the upgrade flag we can retrieve it's changes instead of downloading all over again

Debugging

State operations

Apply

Format code

  • terraform fmt: terraform ftm helps maintain the style of terraform code consistent

Output

Installation


Categories
  • terraform
  • reference