Class TerraformVariable.Builder

java.lang.Object
com.hashicorp.cdktf.TerraformVariable.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<TerraformVariable>
Enclosing class:
TerraformVariable

@Stability(Experimental) public static final class TerraformVariable.Builder extends Object implements software.amazon.jsii.Builder<TerraformVariable>
(experimental) A fluent builder for TerraformVariable.
  • Method Details

    • create

      @Stability(Experimental) public static TerraformVariable.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of TerraformVariable.Builder.
    • defaultValue

      @Stability(Experimental) public TerraformVariable.Builder defaultValue(Object defaultValue)
      Parameters:
      defaultValue - This parameter is required.
      Returns:
      this
    • description

      @Stability(Experimental) public TerraformVariable.Builder description(String description)
      Parameters:
      description - This parameter is required.
      Returns:
      this
    • nullable

      @Stability(Experimental) public TerraformVariable.Builder nullable(Boolean nullable)
      Parameters:
      nullable - This parameter is required.
      Returns:
      this
    • sensitive

      @Stability(Experimental) public TerraformVariable.Builder sensitive(Boolean sensitive)
      Parameters:
      sensitive - This parameter is required.
      Returns:
      this
    • type

      @Stability(Experimental) public TerraformVariable.Builder type(String type)
      (experimental) The type argument in a variable block allows you to restrict the type of value that will be accepted as the value for a variable.

      If no type constraint is set then a value of any type is accepted.

      While type constraints are optional, we recommend specifying them; they serve as easy reminders for users of the module, and allow Terraform to return a helpful error message if the wrong type is used.

      Type constraints are created from a mixture of type keywords and type constructors. The supported type keywords are:

      • string
      • number
      • bool

      The type constructors allow you to specify complex types such as collections:

      • list()
      • set()
      • map()
      • object({ = , ... })
      • tuple([, ...])

      The keyword any may be used to indicate that any type is acceptable. For more information on the meaning and behavior of these different types, as well as detailed information about automatic conversion of complex types, refer to {@link https://developer.hashicorp.com/terraform/language/expressions/type-constraints Type Constraints}.

      If both the type and default arguments are specified, the given default value must be convertible to the specified type.

      Parameters:
      type - The type argument in a variable block allows you to restrict the type of value that will be accepted as the value for a variable. This parameter is required.
      Returns:
      this
    • validation

      @Stability(Experimental) public TerraformVariable.Builder validation(List<? extends TerraformVariableValidationConfig> validation)
      (experimental) Specify arbitrary custom validation rules for a particular variable using a validation block nested within the corresponding variable block.

      Parameters:
      validation - Specify arbitrary custom validation rules for a particular variable using a validation block nested within the corresponding variable block. This parameter is required.
      Returns:
      this
    • build

      @Stability(Experimental) public TerraformVariable build()
      Specified by:
      build in interface software.amazon.jsii.Builder<TerraformVariable>