|
| 1 | +//================================================== |
| 2 | +// Outputs that match the input variables |
| 3 | +//================================================== |
| 4 | +output "command_unix" { |
| 5 | + description = "The value of the `command_unix` input variable, or the default value if the input was `null`, with all carriage returns removed." |
| 6 | + value = local.command_create_unix |
| 7 | +} |
| 8 | +output "command_windows" { |
| 9 | + description = "The value of the `command_windows` input variable, or the default value if the input was `null`, with all carriage returns removed." |
| 10 | + value = local.command_create_windows |
| 11 | +} |
| 12 | +output "command_destroy_unix" { |
| 13 | + description = "The value of the `command_destroy_unix` input variable, or the default value if the input was `null`, with all carriage returns removed." |
| 14 | + value = local.command_destroy_unix |
| 15 | +} |
| 16 | +output "command_destroy_windows" { |
| 17 | + description = "The value of the `command_destroy_windows` input variable, or the default value if the input was `null`, with all carriage returns removed." |
| 18 | + value = local.command_destroy_windows |
| 19 | +} |
| 20 | +output "environment" { |
| 21 | + description = "The value of the `environment` input variable, or the default value if the input was `null`, with all carriage returns removed." |
| 22 | + value = local.env_vars |
| 23 | +} |
| 24 | +output "environment_sensitive" { |
| 25 | + description = "The value of the `environment_sensitive` input variable, or the default value if the input was `null`, with all carriage returns removed." |
| 26 | + value = local.env_vars_sensitive |
| 27 | +} |
| 28 | +output "environment_triggerless" { |
| 29 | + description = "The value of the `environment_triggerless` input variable, or the default value if the input was `null`, with all carriage returns removed." |
| 30 | + value = local.env_vars_triggerless |
| 31 | +} |
| 32 | +output "triggers" { |
| 33 | + description = "The value of the `triggers` input variable, or the default value if the input was `null`." |
| 34 | + value = local.var_triggers |
| 35 | +} |
| 36 | +output "working_dir" { |
| 37 | + description = "The value of the `working_dir` input variable." |
| 38 | + value = local.var_working_dir |
| 39 | +} |
| 40 | +output "fail_create_on_nonzero_exit_code" { |
| 41 | + description = "The value of the `fail_create_on_nonzero_exit_code` input variable, or the default value if the input was `null`." |
| 42 | + value = local.var_fail_create_on_nonzero_exit_code |
| 43 | +} |
| 44 | +output "fail_create_on_stderr" { |
| 45 | + description = "The value of the `fail_create_on_stderr` input variable, or the default value if the input was `null`." |
| 46 | + value = local.var_fail_create_on_stderr |
| 47 | +} |
| 48 | +output "fail_create_on_timeout" { |
| 49 | + description = "The value of the `fail_create_on_timeout` input variable, or the default value if the input was `null`." |
| 50 | + value = local.var_fail_create_on_timeout |
| 51 | +} |
| 52 | +output "fail_destroy_on_nonzero_exit_code" { |
| 53 | + description = "The value of the `fail_destroy_on_nonzero_exit_code` input variable, or the default value if the input was `null`." |
| 54 | + value = local.var_fail_create_on_nonzero_exit_code |
| 55 | +} |
| 56 | +output "fail_destroy_on_stderr" { |
| 57 | + description = "The value of the `fail_destroy_on_stderr` input variable, or the default value if the input was `null`." |
| 58 | + value = local.var_fail_create_on_stderr |
| 59 | +} |
| 60 | +output "fail_destroy_on_timeout" { |
| 61 | + description = "The value of the `fail_destroy_on_timeout` input variable, or the default value if the input was `null`." |
| 62 | + value = local.var_fail_create_on_timeout |
| 63 | +} |
| 64 | +output "timeout_create" { |
| 65 | + description = "The value of the `timeout_create` input variable, or the default value if the input was `null`." |
| 66 | + value = local.var_timeout_create |
| 67 | +} |
| 68 | +output "timeout_destroy" { |
| 69 | + description = "The value of the `timeout_destroy` input variable, or the default value if the input was `null`." |
| 70 | + value = local.var_timeout_destroy |
| 71 | +} |
| 72 | +output "suppress_console" { |
| 73 | + description = "The value of the `suppress_console` input variable, or the default value if the input was `null`." |
| 74 | + value = local.var_suppress_console |
| 75 | +} |
| 76 | +output "unix_interpreter" { |
| 77 | + description = "The value of the `unix_interpreter` input variable, or the default value if the input was `null`." |
| 78 | + value = local.var_unix_interpreter |
| 79 | +} |
| 80 | + |
| 81 | +//================================================== |
| 82 | +// Outputs generated by this module |
| 83 | +//================================================== |
1 | 84 | output "id" { |
2 | 85 | description = "A unique ID for this resource. The ID does not change when the shell command is re-run." |
3 | | - value = random_uuid.uuid.result |
| 86 | + value = local.execution_id |
4 | 87 | } |
5 | | - |
6 | 88 | output "stdout" { |
7 | | - description = "The stdout output of the shell command." |
8 | | - value = local.outputs.stdout |
| 89 | + description = "The stdout output of the shell command, with all carriage returns and trailing newlines removed." |
| 90 | + value = local.stdout_censored |
9 | 91 | } |
10 | | - |
11 | 92 | output "stderr" { |
12 | | - description = "The stderr output of the shell command." |
13 | | - value = local.outputs.stderr |
| 93 | + description = "The stderr output of the shell command, with all carriage returns and trailing newlines removed." |
| 94 | + value = local.stderr_censored |
14 | 95 | } |
15 | | - |
16 | 96 | output "exit_code" { |
17 | | - description = "The exit status code of the shell command." |
18 | | - value = tonumber(local.outputs.exit_code) |
| 97 | + description = "The exit status code of the shell command. If the `timeout` input variable was provided and the command timed out, this will be `null`." |
| 98 | + value = local.outputs.exit_code == null ? null : tonumber(local.outputs.exit_code) |
19 | 99 | } |
20 | | - |
21 | | -output "version" { |
22 | | - description = "The version of the shell resource (see the `track_version` input variable)." |
23 | | - value = var.track_version ? module.state_keeper[0].output : null |
| 100 | +output "null_command_windows" { |
| 101 | + description = "A command that does nothing on Windows systems. You can use this output as the value for the `command_windows` input if you don't want the module to do anything on Windows systems." |
| 102 | + value = local.null_command_windows |
| 103 | +} |
| 104 | +output "null_command_unix" { |
| 105 | + description = "A command that does nothing on Unix-based systems. You can use this output as the value for the `command_unix` input if you don't want the module to do anything on Unix-based systems." |
| 106 | + value = local.null_command_unix |
24 | 107 | } |
0 commit comments