Skip to content

Possible to handle CLI options like -no-color, -json, -target? #816

@Infinoid

Description

@Infinoid

I noticed that initiating a tofu plan or tofu apply from the CLI seems to ignore arguments that affect planning and output generation. I can't apply (or destroy) a targeted subset of resources, and I can't request machine-readable plan output (for parsing out existing resources I need to import, for example).

Is that something the cloud backend protocol allows for? Are these command-line arguments sent to OTF, or does the command line tool just drop them on the floor?

Example: when I run tofu plan -no-color and log the result to a file, the logs look like:

Running plan in cloud backend. Output will stream here. Pressing Ctrl-C
will stop streaming the logs, but will not stop the plan running remotely.

Preparing the remote plan...

To view this run in a browser, visit:
https://otf.host.name/app/org/workspace/runs/run-32tfjJvKavJJ5rko

Waiting for the plan to start...


ESC[0mESC[1mInitializing the backend...ESC[0m
ESC[0mESC[1mInitializing modules...ESC[0m

ESC[0mESC[1mInitializing provider plugins...ESC[0m

Without -no-color, the first lines ("Running plan in cloud backend") are colored yellow. The flag stops that, but has no effect on the plan output sent back by OTF.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions