skadem07 / terraform-shell-resource

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

terraform-shell-resource

Build Status

This module runs a command as a null_resource and makes the stdout, stderr and exit status available as outputs (with temporary files stored in the module). See an external data source version with more features at https://github.com/matti/terraform-shell-outputs (that runs on every apply, this one only runs once when the resource is created).

warning there is a support for trigger to re-run the module, but while it runs the command it does not update the outputs! There is nothing we can do before related issues (see below) are fixed.

module "files" {
  source  = "matti/resource/shell"
  command = "ls -l"
}

output "my_files" {
  value = "${module.files.stdout}
}

Additional examples

See tests

Related issues:

About

License:MIT License


Languages

Language:HCL 58.7%Language:Shell 41.3%