Skip to content

conn3x output

conn3x output prints the root module’s output values, as recorded in state by the last apply. It doesn’t connect to the cloud or the hosts. Conn3x doesn’t change this command.

Terminal window
conn3x output [options] [NAME]

With no NAME, it prints every output.

Option Description
-json Print JSON. With no NAME, each output’s value, type and whether it’s sensitive.
-raw Print a single string, number or boolean output without quotes or formatting. Needs NAME.
-show-sensitive Show sensitive values instead of <sensitive>.
-no-color Don’t use terminal colors.

For the remaining options, see OpenTofu’s output page.

Terminal window
$ conn3x output
web_ip = "203.0.113.10"

Use a value in a script:

Terminal window
ssh "root@$(conn3x output -raw web_ip)"
Terminal window
$ conn3x output -json
{
"web_ip": {
"sensitive": false,
"type": "string",
"value": "203.0.113.10"
}
}

A step’s read-only attributes, such as a command step’s stdout, can be outputs too:

output "migrate_log" {
value = conn3x_command.app__migrate["web1"].stdout
}
Code Meaning
0 Success.
1 An error, such as an output that isn’t in state.