# README
terraform-provider-oneshot
Terraform provider for running one-shot commands.
Usage
terraform {
required_providers {
oneshot = {
source = "winebarrel/oneshot"
version = ">= 0.3.0"
}
}
}
provider "oneshot" {
# shell = "/bin/bash -c"
}
resource "oneshot_run" "hello" {
command = "echo 'hello, oneshot'"
# stdout_log = "stdout.log"
# stderr_log = "stderr.log"
# NOTE: "plan_command" is executed at plan time
plan_command = "echo \"hello, oneshot (plan=$ONESHOT_PLAN)\""
# plan_stdout_log = "plan-stdout.log"
# plan_stderr_log = "plan-stderr.log"
}
Run locally for development
cp oneshot.tf.sample oneshot.tf
make
make tf-plan
cat plan-stdout.log
cat plan-stderr.log
make tf-apply
cat stdout.log
cat stderr.log