Package com.hashicorp.cdktf
Class LocalExecProvisioner.Builder
java.lang.Object
com.hashicorp.cdktf.LocalExecProvisioner.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<LocalExecProvisioner>
- Enclosing interface:
LocalExecProvisioner
@Stability(Experimental)
public static final class LocalExecProvisioner.Builder
extends Object
implements software.amazon.jsii.Builder<LocalExecProvisioner>
A builder for
LocalExecProvisioner
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofLocalExecProvisioner.getCommand()
environment
(Map<String, String> environment) Sets the value ofLocalExecProvisioner.getEnvironment()
interpreter
(List<String> interpreter) Sets the value ofLocalExecProvisioner.getInterpreter()
Sets the value ofLocalExecProvisioner.getType()
Sets the value ofLocalExecProvisioner.getWhen()
workingDir
(String workingDir) Sets the value ofLocalExecProvisioner.getWorkingDir()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
command
Sets the value ofLocalExecProvisioner.getCommand()
- Parameters:
command
- This is the command to execute. This parameter is required. 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.- Returns:
this
-
type
Sets the value ofLocalExecProvisioner.getType()
- Parameters:
type
- the value to be set. This parameter is required.- Returns:
this
-
environment
@Stability(Experimental) public LocalExecProvisioner.Builder environment(Map<String, String> environment) Sets the value ofLocalExecProvisioner.getEnvironment()
- Parameters:
environment
- A record of key value pairs representing the environment of the executed command. It inherits the current process environment.- Returns:
this
-
interpreter
Sets the value ofLocalExecProvisioner.getInterpreter()
- Parameters:
interpreter
- 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.- Returns:
this
-
when
Sets the value ofLocalExecProvisioner.getWhen()
- Parameters:
when
- 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- Returns:
this
-
workingDir
Sets the value ofLocalExecProvisioner.getWorkingDir()
- Parameters:
workingDir
- 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.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<LocalExecProvisioner>
- Returns:
- a new instance of
LocalExecProvisioner
- Throws:
NullPointerException
- if any required attribute was not provided
-