Terraform Console

The terraform console command provides an interactive console for evaluating expressions.

This command provides an interactive command-line console for evaluating and experimenting with expressions.

This is useful for testing interpolations before using them in configurations, and for interacting with any values currently saved in state.

If the current state is empty or has not yet been created, the console can be used to experiment with the expression syntax and built-in functions.

The dir argument specifies the directory of the root module to use. If a path is not specified, the current working directory is used.

The supported options are:

  • -state=path - Path to a local state file. Expressions will be evaluated using values from this state file. If not specified, the state associated with the current workspace is used.

You can close the console with the exit command or by pressing Control-C or Control-D.

Demo Video

Demo Video