shell-data

Invicton-Labs/shell-data/external

Terraform Module HCL EXTERNAL
Install
module "shell-data" {
source = "Invicton-Labs/shell-data/external"
version = "0.4.2"
}
plain text: /constructs/tfmod-invicton-labs-shell-data-external/install.txt
⭐ Source on GitHub 📦 Registry page
README

!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,

Inputs (14)
NameTypeDescriptionDefault
command_unixstringThe command to run on creation when the module is used on a Unix machine. If notnull
fail_on_nonzero_exit_codeboolWhether a Terraform error should be thrown if the command exits with a non-zero true
fail_on_stderrboolWhether a Terraform error should be thrown if the command outputs anything to stfalse
timeoutnumberThe maximum number of seconds to allow the shell command to execute for If it enull
fail_on_timeoutboolWhether a Terraform error should be thrown if the command times out. If true, notrue
suppress_consoleboolWhether to suppress the Terraform console output (including plan content and shetrue
command_windowsstringThe command to run on creation when the module is used on a Windows machine. If null
unix_interpreterstringThe interpreter to use when running commands on a Unix-based system. This is pri"/bin/sh"
execution_idstringA unique ID for the shell execution. USED FOR DEVELOPMENT ONLY and will default null
dynamic_depends_onanyThis input variable has the same function as the `depends_on` built-in variable,null
environmentmap(string)Map of environment variables to pass to the command.{}
environment_sensitivemap(string)Map of sensitive environment variables to pass to the command. If any of these v{}
working_dirstringThe working directory where command will be executed. Defaults to this module's null
force_wait_for_applyboolWhether to force this module to wait for apply-time to execute the shell commandfalse
Outputs (16)
environment — The value of the `environment` input variable, or the default value if the input was `null`, with al
force_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 comm
null_command_windows — A command that does nothing on Windows systems. You can use this output as the value for the `comman
dynamic_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`, wit
working_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 `com
command_unix — The value of the `command_unix` input variable, or the default value if the input was `null`, with a
fail_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 `
Details
FrameworkTerraform Module
LanguageHCL
Version0.4.2
Cloud EXTERNAL
Total downloads1.8M
Inputs14
Outputs16
NamespaceInvicton-Labs
Updated