Skip to main content

Initializers

import io.cdktn.cdktn.TerraformVariable;

TerraformVariable.Builder.create(Construct scope, java.lang.String id)
//  .default(java.lang.Object)
//  .description(java.lang.String)
//  .nullable(java.lang.Boolean)
//  .sensitive(java.lang.Boolean)
//  .type(java.lang.String)
//  .validation(java.util.List<TerraformVariableValidationConfig>)
    .build();
NameTypeDescription
scopesoftware.constructs.ConstructNo description.
idjava.lang.StringNo description.
defaultjava.lang.ObjectNo description.
descriptionjava.lang.StringNo description.
nullablejava.lang.BooleanNo description.
sensitivejava.lang.BooleanNo description.
typejava.lang.StringThe type argument in a variable block allows you to restrict the type of value that will be accepted as the value for a variable.
validationjava.util.List<TerraformVariableValidationConfig>Specify arbitrary custom validation rules for a particular variable using a validation block nested within the corresponding variable block.

scopeRequired

  • Type: software.constructs.Construct

idRequired

  • Type: java.lang.String

defaultOptional

  • Type: java.lang.Object

descriptionOptional

  • Type: java.lang.String

nullableOptional

  • Type: java.lang.Boolean

sensitiveOptional

  • Type: java.lang.Boolean

typeOptional

  • Type: java.lang.String
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(< TYPE >)
  • set(< TYPE >)
  • map(< TYPE >)
  • object({< ATTR NAME > = < TYPE >, … })
  • tuple([< TYPE >, …])
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 Type Constraints. If both the type and default arguments are specified, the given default value must be convertible to the specified type.

validationOptional

Specify arbitrary custom validation rules for a particular variable using a validation block nested within the corresponding variable block.

Methods

NameDescription
toStringReturns a string representation of this construct.
addOverrideNo description.
overrideLogicalIdOverrides the auto-generated logical ID with a specific ID.
resetOverrideLogicalIdResets a previously passed logical Id to use the auto-generated logical id again.
toHclTerraformNo description.
toMetadataNo description.
toTerraformNo description.
addValidationNo description.
synthesizeAttributesNo description.
synthesizeHclAttributesNo description.

toString

public java.lang.String toString()
Returns a string representation of this construct.

addOverride

public void addOverride(java.lang.String path, java.lang.Object value)

pathRequired

  • Type: java.lang.String

valueRequired

  • Type: java.lang.Object

overrideLogicalId

public void overrideLogicalId(java.lang.String newLogicalId)
Overrides the auto-generated logical ID with a specific ID.

newLogicalIdRequired

  • Type: java.lang.String
The new logical ID to use for this stack element.

resetOverrideLogicalId

public void resetOverrideLogicalId()
Resets a previously passed logical Id to use the auto-generated logical id again.

toHclTerraform

public java.lang.Object toHclTerraform()

toMetadata

public java.lang.Object toMetadata()

toTerraform

public java.lang.Object toTerraform()

addValidation

public void addValidation(TerraformVariableValidationConfig validation)

validationRequired


synthesizeAttributes

public java.util.Map<java.lang.String, java.lang.Object> synthesizeAttributes()

synthesizeHclAttributes

public java.util.Map<java.lang.String, java.lang.Object> synthesizeHclAttributes()

Static Functions

NameDescription
isConstructChecks if x is a construct.
isTerraformElementNo description.

isConstruct

import io.cdktn.cdktn.TerraformVariable;

TerraformVariable.isConstruct(java.lang.Object x)
Checks if x is a construct. Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked. Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired

  • Type: java.lang.Object
Any object.

isTerraformElement

import io.cdktn.cdktn.TerraformVariable;

TerraformVariable.isTerraformElement(java.lang.Object x)

xRequired

  • Type: java.lang.Object

Properties

NameTypeDescription
nodesoftware.constructs.NodeThe tree node.
cdktfStackTerraformStackNo description.
fqnjava.lang.StringNo description.
friendlyUniqueIdjava.lang.StringNo description.
booleanValueIResolvableNo description.
listValuejava.util.List< java.lang.String >No description.
numberValuejava.lang.NumberNo description.
stringValuejava.lang.StringNo description.
valuejava.lang.ObjectNo description.
defaultjava.lang.ObjectNo description.
descriptionjava.lang.StringNo description.
nullablejava.lang.BooleanNo description.
sensitivejava.lang.BooleanNo description.
typejava.lang.StringNo description.
validationjava.util.List<TerraformVariableValidationConfig>No description.

nodeRequired

public Node getNode();
  • Type: software.constructs.Node
The tree node.

cdktfStackRequired

public TerraformStack getCdktfStack();

fqnRequired

public java.lang.String getFqn();
  • Type: java.lang.String

friendlyUniqueIdRequired

public java.lang.String getFriendlyUniqueId();
  • Type: java.lang.String

booleanValueRequired

public IResolvable getBooleanValue();

listValueRequired

public java.util.List<java.lang.String> getListValue();
  • Type: java.util.List< java.lang.String >

numberValueRequired

public java.lang.Number getNumberValue();
  • Type: java.lang.Number

stringValueRequired

public java.lang.String getStringValue();
  • Type: java.lang.String

valueRequired

public java.lang.Object getValue();
  • Type: java.lang.Object

defaultOptional

public java.lang.Object getDefault();
  • Type: java.lang.Object

descriptionOptional

public java.lang.String getDescription();
  • Type: java.lang.String

nullableOptional

public java.lang.Boolean getNullable();
  • Type: java.lang.Boolean

sensitiveOptional

public java.lang.Boolean getSensitive();
  • Type: java.lang.Boolean

typeOptional

public java.lang.String getType();
  • Type: java.lang.String

validationOptional

public java.util.List<TerraformVariableValidationConfig> getValidation();