shell-data
Invicton-Labs/shell-data/external
!Build Terraform Shell (Data) On the Terraform Registry: Invicton-Labs/shell-data/external This module provides a wrapper for running shell scripts as data sources (re-run on every plan/apply) and capturing the output. Unlike Terraform's standard External Data Source, this module supports: - Environment variables - Capturing stdout, stderr, and exit_code of the command - Built-in support for all major flavors of Linux, all POSIX-compatible shells, Windows, and MacOS - Optional Terraform failure when an error in the given command occurs - Optional timeouts for commands For Windows, this module should work on any system that supports a relatively modern version of PowerShell. For Unix (Linux and MacOS), this module should work on any POSIX-compatible shell that supports echo, cat, cut, head,
| Name | Type | Description | Default |
|---|---|---|---|
| command_unix | string | The command to run on creation when the module is used on a Unix machine. If not | null |
| fail_on_nonzero_exit_code | bool | Whether a Terraform error should be thrown if the command exits with a non-zero | true |
| fail_on_stderr | bool | Whether a Terraform error should be thrown if the command outputs anything to st | false |
| timeout | number | The maximum number of seconds to allow the shell command to execute for If it e | null |
| fail_on_timeout | bool | Whether a Terraform error should be thrown if the command times out. If true, no | true |
| suppress_console | bool | Whether to suppress the Terraform console output (including plan content and she | true |
| command_windows | string | The command to run on creation when the module is used on a Windows machine. If | null |
| unix_interpreter | string | The interpreter to use when running commands on a Unix-based system. This is pri | "/bin/sh" |
| execution_id | string | A unique ID for the shell execution. USED FOR DEVELOPMENT ONLY and will default | null |
| dynamic_depends_on | any | This input variable has the same function as the `depends_on` built-in variable, | null |
| environment | map(string) | Map of environment variables to pass to the command. | {} |
| environment_sensitive | map(string) | Map of sensitive environment variables to pass to the command. If any of these v | {} |
| working_dir | string | The working directory where command will be executed. Defaults to this module's | null |
| force_wait_for_apply | bool | Whether to force this module to wait for apply-time to execute the shell command | false |
environment — The value of the `environment` input variable, or the default value if the input was `null`, with alforce_wait_for_apply — The value of the `force_wait_for_apply` input variable, or the default value if the input was `null`timeout — The value of the `timeout` input variable.fail_on_timeout — The value of the `fail_on_timeout` input variable, or the default value if the input was `null`.unix_interpreter — The value of the `unix_interpreter` input variable, or the default value if the input was `null`.stdout — The stdout output of the shell command, with all carriage returns and trailing newlines removed.exit_code — The exit status code of the shell command. If the `timeout` input variable was provided and the commnull_command_windows — A command that does nothing on Windows systems. You can use this output as the value for the `commandynamic_depends_on — The value of the `dynamic_depends_on` input variable.command_windows — The value of the `command_windows` input variable, or the default value if the input was `null`, witworking_dir — The value of the `working_dir` input variable.stderr — The stderr output of the shell command, with all carriage returns and trailing newlines removed.null_command_unix — A command that does nothing on Unix-based systems. You can use this output as the value for the `comcommand_unix — The value of the `command_unix` input variable, or the default value if the input was `null`, with afail_on_stderr — The value of the `fail_on_stderr` input variable, or the default value if the input was `null`.fail_on_nonzero_exit_code — The value of the `fail_on_nonzero_exit_code` input variable, or the default value if the input was `