====== terraform ====== ===== variables ===== ==== variable types ==== * [[terraform:inputvariables|Input Variables]]: These are used to pass dynamic values to Terraform configurations. * [[terraform:environmentvariables|Environment Variables]]: These are used to set values for Terraform commands or to provide sensitive data. * [[terraform:outputvariables|Output Variables]]: These are used to expose values from a Terraform configuration to be used by other configurations or by external systems. ==== Types of Variables ==== Terraform supports several types of variables: * String: A single string value. * Number: A numeric value. * Bool: A boolean value. * [[terraform:list|List]]: A list of values. * Map: A key-value pair. * Object: A collection of named attributes that each have their own type. * [[terraform:tuple|Tuple]]: A sequence of elements identified by their order and each have their own type. ==== Working with variables ==== * [[terraform:variabletypeconstraints|Variable Type Constraints]]: You can specify the type of a variable to enforce that the provided value matches the expected type. * [[terraform:usingvariablesinconfiguration|Using Variables in Configuration]]: Variables can be accessed using the var keyword. * [[terraform:providingvaluesforvariables|Providing Values for Variables]]: Values for variables can be provided in several ways * [[terraform:variablevalidation|Variable Validation]]: You can add validation rules to ensure that input values meet certain criteria. * [[terraform:sensitivevariables|Sensitive Variables]]: Sensitive variables are used to store sensitive information like passwords. * [[terraform:defaultvalues|Default Values]]: Variables can have default values, which are used if no other value is provided. * [[terraform:conditionalexpressionswithvariables|Conditional Expressions with Variables]]: Terraform supports conditional expressions that can be used to assign variable values based on conditions.