From d7af2c4d395a23fa93a80d878606e3f1c7717bce Mon Sep 17 00:00:00 2001 From: Oleksandr Levchenkov Date: Tue, 14 Jan 2025 19:03:30 +0200 Subject: [PATCH] update tofu console docs for non-interactive use-case (#2369) Signed-off-by: ollevche Signed-off-by: Oleksandr Levchenkov Co-authored-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> --- website/docs/cli/commands/console.mdx | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/website/docs/cli/commands/console.mdx b/website/docs/cli/commands/console.mdx index ef7dd87f01..4dd610c298 100644 --- a/website/docs/cli/commands/console.mdx +++ b/website/docs/cli/commands/console.mdx @@ -9,6 +9,11 @@ description: >- The `tofu console` command provides an interactive console for evaluating [expressions](../../language/expressions/index.mdx). +:::warning +The `tofu console` command is not designed for use in scripts. You can use it, but +you may find that some functions don't work as intended. +::: + ## Usage Usage: `tofu console [options]` @@ -54,23 +59,6 @@ There are several other ways to set values for input variables in the root module, aside from the `-var` and `-var-file` options. Refer to [Assigning Values to Root Module Variables](../../language/values/variables.mdx#assigning-values-to-root-module-variables) for more information. -## Scripting - -The `tofu console` command can be used in non-interactive scripts -by piping newline-separated commands to it. Only the output from the -final command is printed unless an error occurs earlier. - -For example: - -```shell -$ echo 'split(",", "foo,bar,baz")' | tofu console -tolist([ - "foo", - "bar", - "baz", -]) -``` - ## Remote State If [remote state](../../language/state/remote.mdx) is used by the current backend,