terraform-provider-execute

command module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

README

terraform-provider-execute

Terraform plugin mostly based on https://github.com/gosuri/terraform-exec-provider (thanks!!!). Provides an ability to execute arbitrary commands on Terraform create and destroy.

Usage

resource "execute_command" "command" {
  command "/path/to/command"
  destroy_command "/path/to/command"
}
Attribute reference
  • command - (Required) Command to execute on terraform Create
  • destroy_command - (Optional) Command to execute on terraform destroy
  • only_if - (Optional) Guard attribute, to create the resource (Execute) the command only if this guard is satisfied. If the command returns 0, the guard is applied. If the command returns any other value, then the guard attribute is not applied.
Examples

The below example will create a 'testfile' file when you run 'terraform apply' and delete the 'testfile' file when you run 'terraform destroy'

resource "execute_command" "commands" {
  command = "touch testfile"
  destroy_command = "rm testfile"
}

Installation

$ git clone https://github.com/samsung-cnct/terraform-provider-execute.git
$ cd terraform-exec-provider
$ go get; go build

Then copy the resulting binary to where terraform binary is.

With Homebrew

$ brew tap 'samsung-cnct/terraform-provider-execute'
$ brew install terraform-provider-execute

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL