Interface VariablesSpec


  • public interface VariablesSpec
    Describes variables for Terraform and OpenTofu.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      default void file​(java.lang.Object fileName)
      Deprecated.
      void files​(java.lang.Object... fileNames)
      Adds one or more file names containing terraform variables.
      RemoteStateVarProvider getRemoteStateMap()
      Provide access to a remote state configuration.
      void list​(java.lang.String name, java.lang.Iterable<?> vals)
      Adds a list as a variable.
      void list​(java.lang.String name, java.lang.Object val1, java.lang.Object... vals)
      Adds a list as a variable.
      void map​(java.lang.String name, org.gradle.api.provider.Provider<java.util.Map<java.lang.String,​?>> mapProvider)
      Adds a map provider as a variable.
      void map​(java.util.Map<java.lang.String,​?> map, java.lang.String name)
      Adds a map as a variable.
      void provider​(org.gradle.api.Action<VariablesSpec> additionalVariables)
      Adds additional actions which can add variables.
      void remoteStateMap​(groovy.lang.Closure<?> configurator)
      Configure the injection of a map for terraform_remote_state usage.
      void remoteStateMap​(org.gradle.api.Action<RemoteStateVarProvider> configurator)
      Configure the injection of a map for terraform_remote_state usage.
      void var​(java.lang.String name, java.lang.Object value)
      Adds one variable.
    • Method Detail

      • var

        void var​(java.lang.String name,
                 java.lang.Object value)
        Adds one variable.

        This will replace any previous entry by the same name.

        Parameters:
        name - Name of variable.
        value - Lazy-evaluated form of variable. Anything resolvable via StringTools.stringize(Object) is accepted.
      • map

        void map​(java.util.Map<java.lang.String,​?> map,
                 java.lang.String name)
        Adds a map as a variable.

        This will replace any previous entry by the same name.

        Parameters:
        name - Name of variable.
        map - Lazy-evaluated forms of variable. Anything resolvable via StringTools.stringizeValues(java.util.Map<java.lang.String, ?>) is accepted.
      • map

        void map​(java.lang.String name,
                 org.gradle.api.provider.Provider<java.util.Map<java.lang.String,​?>> mapProvider)
        Adds a map provider as a variable.

        This will replace any previous map by the same name.

        Parameters:
        name - Name of map
        mapProvider - Provider to map
      • list

        void list​(java.lang.String name,
                  java.lang.Object val1,
                  java.lang.Object... vals)
        Adds a list as a variable.

        This will replace any previous entry by the same name.

        Parameters:
        name - Name of variable.
        val1 - First
        vals - Lazy-evaluated forms of variable. Anything resolvable via StringTools.stringize(java.lang.Object) is accepted.
      • list

        void list​(java.lang.String name,
                  java.lang.Iterable<?> vals)
        Adds a list as a variable.

        This will replace any previous entry by the same name.

        Parameters:
        name - Name of variable.
        vals - Lazy-evaluated forms of variable. Anything resolvable via StringTools.stringize(java.lang.Object) is accepted.
      • file

        @Deprecated
        default void file​(java.lang.Object fileName)
        Deprecated.
        Adds a name of a file containing terraform variables.
        Parameters:
        fileName - Files that can be converted via StringTools.stringize(java.lang.Object) and resolved relative to the appropriate source set.
      • files

        void files​(java.lang.Object... fileNames)
        Adds one or more file names containing terraform variables.
        Parameters:
        fileNames - Files that can be converted via StringTools.stringize(java.lang.Object) and resolved relative to the appropriate source set.
      • provider

        void provider​(org.gradle.api.Action<VariablesSpec> additionalVariables)
        Adds additional actions which can add variables. These will be called first when evaluating a final escaped variable map.
        Parameters:
        additionalVariables - Action that can be called to provide additional variables.
      • remoteStateMap

        void remoteStateMap​(org.gradle.api.Action<RemoteStateVarProvider> configurator)
        Configure the injection of a map for terraform_remote_state usage.
        Parameters:
        configurator - Configuration action.
      • remoteStateMap

        void remoteStateMap​(@DelegatesTo(RemoteStateVarProvider.class)
                            groovy.lang.Closure<?> configurator)
        Configure the injection of a map for terraform_remote_state usage.
        Parameters:
        configurator - Configuration closure.