Skip to main content
TerraformVariable allows you to define input variables for your Terraform configuration.

Constructor

new TerraformVariable(scope: Construct, id: string, config: TerraformVariableConfig)

TerraformVariableConfig

PropertyTypeDescription
typestringThe type of the variable (e.g., string, number, bool, list(string)).
defaultanyThe default value for the variable.
descriptionstringA description of the variable.
sensitivebooleanWhether the variable contains sensitive information.
nullablebooleanWhether the variable can be null.
validationTerraformVariableValidation[]Validation rules for the variable.

Properties

value

readonly value: any The value of the variable (as a token).

stringValue

readonly stringValue: string The value of the variable cast to a string.

numberValue

readonly numberValue: number The value of the variable cast to a number.

booleanValue

readonly booleanValue: boolean The value of the variable cast to a boolean.

listValue

readonly listValue: string[] The value of the variable cast to a list of strings.