Skip to main content
The local-exec provisioner invokes a local executable after a resource is created. This invokes a process on the machine running Terraform, not on the resource. See local-exec

Initializer

import "github.com/open-constructs/cdk-terrain-go/cdktn"

&cdktn.LocalExecProvisioner {
	Command: *string,
	Type: *string,
	Environment: *map[string]*string,
	Interpreter: *[]*string,
	When: *string,
	WorkingDir: *string,
}

Properties

NameTypeDescription
Command*stringThis is the command to execute.
Type*stringNo description.
Environment*map[string]*stringA record of key value pairs representing the environment of the executed command.
Interpreter*[]*stringIf provided, this is a list of interpreter arguments used to execute the command.
When*stringIf provided, specifies when Terraform will execute the command.
WorkingDir*stringIf provided, specifies the working directory where command will be executed.

CommandRequired

Command *string
  • Type: *string
This is the command to execute. It can be provided as a relative path to the current working directory or as an absolute path. It is evaluated in a shell, and can use environment variables or Terraform variables.

TypeRequired

Type *string
  • Type: *string

EnvironmentOptional

Environment *map[string]*string
  • Type: *map[string]*string
A record of key value pairs representing the environment of the executed command. It inherits the current process environment.

InterpreterOptional

Interpreter *[]*string
  • Type: *[]*string
If provided, this is a list of interpreter arguments used to execute the command. The first argument is the interpreter itself. It can be provided as a relative path to the current working directory or as an absolute path The remaining arguments are appended prior to the command. This allows building command lines of the form “/bin/bash”, “-c”, “echo foo”. If interpreter is unspecified, sensible defaults will be chosen based on the system OS.

WhenOptional

When *string
  • Type: *string
If provided, specifies when Terraform will execute the command. For example, when = destroy specifies that the provisioner will run when the associated resource is destroyed

WorkingDirOptional

WorkingDir *string
  • Type: *string
If provided, specifies the working directory where command will be executed. It can be provided as a relative path to the current working directory or as an absolute path. The directory must exist.