This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| virtualization:cloud:terraform [2023/09/29 15:07] – jotasandoku | virtualization:cloud:terraform [2023/11/02 14:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 28: | Line 28: | ||
| terraform plan -out example1.tfplan | terraform plan -out example1.tfplan | ||
| terraform apply example1.tfplan | terraform apply example1.tfplan | ||
| + | | ||
| + | . | ||
| + | |||
| + | terraform state list # enumerates all state elements | ||
| + | terraform state show < | ||
| ---- | ---- | ||
| | | ||
| + | \\ | ||
| + | Do not confuse with data sources. Output comes from the successful creation of a thing (like the output of a module). Data is accessing a thing that already exists but isn't necessarily managed in this state. E.g. getting a vpc id when your networking layer is in a different terraform state, | ||
| data " | data " | ||
| Line 56: | Line 63: | ||
| * terraform.tfvars : tfvars file extension is in the root folder of an environment to define values to variables. So we use a *.tfvar file to load in defaults as they are automatically loaded without any additional command line option. | * terraform.tfvars : tfvars file extension is in the root folder of an environment to define values to variables. So we use a *.tfvar file to load in defaults as they are automatically loaded without any additional command line option. | ||
| * variables.tf : the .tf uses modules to declare them | * variables.tf : the .tf uses modules to declare them | ||
| - | + | * variable.tfvar vs. variable.tf | |
| - | variable.tfvar vs. variable.tf | + | |
| * **VARIABLE TYPES:** | * **VARIABLE TYPES:** | ||
| Line 207: | Line 213: | ||
| - | **OUTPUTS**: | + | **OUTPUTS**: |
| + | \\ | ||
| + | Do not confuse with data sources. Output comes from the successful creation of a thing (like the output of a module). Data is accessing a thing that already exists but isn't necessarily managed in this state. E.g. getting a vpc id when your networking layer is in a different terraform state, | ||
| \\ | \\ | ||
| Example1: | Example1: | ||
| Line 290: | Line 298: | ||
| number_of_buckets = var.bucket_count > 0 ? var.bucket_count : local.minimum_number_of_buckets | number_of_buckets = var.bucket_count > 0 ? var.bucket_count : local.minimum_number_of_buckets | ||
| } | } | ||
| + | |||
| + | |||
| ---- | ---- | ||
| + | |||
| + | **TEMPLATING WITH HEREDOCS** | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | ---- | ||
| + | **ITERATIONS** | ||
| + | * By means of [[https:// | ||
| + | |||
| + | ---- | ||
| Install tf:\\ | Install tf:\\ | ||