What is this
terraform-provider-cmdexec provides command execution from Terraform Configuration.
Terraform has local-exec provisioner by default. but provisioner is executed when terraform apply. On the other hand, terraform-provider-cmdexec execute a command when terraform plan.
This provider was originally created for penetration testing of CI/CD pipeline.
Requirements
How to use
To install the provider, please run make install.
make install
To use the provider, please write datasource.
value of command is executed.
data "cmdexec_execute" "sample" {
command = "echo test"
}
To get output of the executed command when terraform plan, please write resource.
resource "cmdexec_output" "sample" {
rc = data.cmdexec_execute.sample.rc
output = data.cmdexec_execute.sample.output
}
To build the provider for Linux(x64), please run make build-linux
make build-linux