/
Terraform Commands

Terraform Commands

The following are basic commands you will use while working with the Infoblox Terraform Provider. For additional information and reference for all Terraform commands, refer to the documentation here . All commands will begin with terraform, followed by a subcommand. Screenshots of some commands are shown here; others will be shown in the Examples section.

 

  •  terraform -help: This command displays the common commands available for Terraform.

  •  terraform -version: This command displays the version of Terraform installed on your computer.

  •  terraform init: This command is used to initialize a working directory containing Terraform configuration files and install Terraform providers such as the Infoblox plugin. This command must be run in a directory prior to apply or plan. A screenshot is provided in the Examples section. 

  • terraform validate: This command is used to verify that configuration files in the working directory are valid. Configuration files are validated for syntax and internal consistency. This is applied only to the configuration and does not access any remote services such as provider APIs. 

  •  terraform plan -out=<path/file>: The plan command creates an execution plan by determining the actions needed to achieve a desired state based on the configuration files in your directory. This command does not make any changes and is a good way to verify that your configuration files will give the desired result prior to executing. The -out parameter is optional and records the plan for later use when applying the configuration. A screenshot is provided in the Examples section. 

  • terraform apply<plan_file> : The apply command executes changes required to meet the desired state based on configuration files in your directory. Optionally, add the name of the file output by the plan command to execute the predetermined actions from the plan command. A screenshot is provided in the Examples section.

  •  terraform destroy: This command is used to de-provision Terraform managed infrastructure defined by the configuration files in your directory. The destroy command will ask for confirmation unless the -auto-approve argument is used. A screenshot is provided in the Examples section.

Related content