Difference between revisions of "Terraform variables: variables.tf"

From wikieduonline
Jump to navigation Jump to search
Line 4: Line 4:
 
* https://learn.hashicorp.com/tutorials/terraform/aws-variables
 
* https://learn.hashicorp.com/tutorials/terraform/aws-variables
  
Example:
+
== Example ==
 +
 
 +
Definition in <code>[[variables.tf]]</code>
 
  variable "yourvarname" {
 
  variable "yourvarname" {
 
   type = string
 
   type = string
Line 11: Line 13:
 
  }
 
  }
  
 +
Usage in <code>[[main.tf]]</code>
  
  

Revision as of 09:48, 5 September 2021

Example

Definition in variables.tf

variable "yourvarname" {
  type = string
  description = "Description of your variable"
  default = "your_default_value"
}

Usage in main.tf


Related term

See also

Advertising: