@groovy.transform.CompileStatic class Variables
A configuration building block for tasks that need to pass variables to
a terraform task
.
Constructor and description |
---|
Variables
(Provider<java.io.File> rootFileResolver) Attach this configuration block to a Terraform extension or source directory set |
Variables
(VarsFilesPair vfp, Provider<java.io.File> rootFileResolver) Constructs instance from definition of files and variables |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
clear() Removes all existing variables and file references. |
|
void |
file(java.lang.Object fileName) Adds a name of a file containing terraform variables. |
|
VarsFilesPair |
getAllVars() Returns a description of the files and variables |
|
java.util.List<java.lang.String> |
getCommandLineArgs() |
|
java.util.Map<java.lang.String, java.lang.String> |
getEscapedVars() Evaluate all provided and local variables and convert them to Terraform-compliant strings, ready to be passed to command-line. |
|
java.util.Set<java.lang.String> |
getFileNames() List of file names containing Terraform variables. |
|
java.util.List<groovy.lang.Closure> |
getInputProperties() |
|
java.util.List<java.lang.String> |
getTfVars() |
|
void |
list(java.lang.String name, java.lang.Object val1, java.lang.Object... vals) Adds a list as a variable. |
|
void |
list(java.lang.String name, java.lang.Iterable<?> vals) Adds a list as a variable. |
|
void |
map(java.util.Map<java.lang.String, ?> map, java.lang.String name) Adds a map as a variable. |
|
void |
map(java.lang.String name, Provider<java.util.Map<java.lang.String, ?>> mapProvider) Adds a map provider as a variable. |
|
void |
provider(Action<VariablesSpec> additionalVariables) Adds additional actions which can add variables. |
|
java.lang.String |
toString() |
|
void |
var(java.lang.String name, java.lang.Object value) Adds one variable. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Attach this configuration block to a Terraform extension or source directory set
rootFileResolver
- Root file resolver for file that are referenced.Constructs instance from definition of files and variables
vfp
- Definition of files and variablesrootFileResolver
- Root file resolver for file that are referenced.Removes all existing variables and file references.
Adds a name of a file containing terraform
variables.
fileName
- Files that can be converted via
org.ysb33r.grolifant.api.v4.StringUtils#stringize(Object o) and resolved relative to the appropriate
TerraformSourceDirectorySet.Returns a description of the files and variables
Evaluate all provided and local variables and convert them to Terraform-compliant strings, ready to be passed to command-line. Provided variables will be evaluated first, so that any local definitions can override them.
Calling this will resolve all lazy-evaluated entries.
List of file names containing Terraform variables. Filenames can contain relative paths.
Adds a list as a variable.
This will replace any previous entry by the same name.
name
- Name of variable.val1
- Firstvals
- Lazy-evaluated forms of variable. Anything resolvable via
org.ysb33r.grolifant.api.v4.StringUtils#stringize<?> is accepted.Adds a list as a variable.
This will replace any previous entry by the same name.
name
- Name of variable.vals
- Lazy-evaluated forms of variable. Anything resolvable via
org.ysb33r.grolifant.api.v4.StringUtils#stringize<?> is accepted.Adds a map as a variable.
This will replace any previous entry by the same name.
name
- Name of variable.val1
- Firstmap
- Lazy-evaluated form of map.
Anything resolvable via org.ysb33r.grolifant.api.v4.MapUtils#stringizeValues(Map)
is accepted.Adds a map provider as a variable.
This will replace any previous map by the same name.
name
- Name of mapmapProvider
- Provider to mapAdds additional actions which can add variables. These will be called first when evaluating a final escaped variable map.
additionalVariables
- Action that can be called to provide additional variables.Adds one variable.
This will replace any previous entry by the same name.
name
- Name of variable.value
- Lazy-evaluated form of variable. Anything resolvable via
org.ysb33r.grolifant.api.v4.StringUtils#stringize(Object)
is accepted.Groovy Documentation